openAuth protocol error

5 views
Skip to first unread message

elad2109

unread,
Mar 2, 2012, 5:26:31 PM3/2/12
to DotNetOpenAuth
Why do I get openAuth protocol error ?

{"The remote server returned an error: (400) Bad Request."}

at System.Net.HttpWebRequest.GetResponse() at
DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest
request, DirectWebRequestOptions options) in c:\BuildAgent\work
\a02b428f36957bca\src\DotNetOpenAuth\Messaging
\StandardWebRequestHandler.cs:line 126

public static readonly ServiceProviderDescription
ServiceDescription = new ServiceProviderDescription
{
RequestTokenEndpoint =
new MessageReceivingEndpoint("https://www.google.com/account/
OAuthGetRequestToken", HttpDeliveryMethods.AuthorizationHeaderRequest
| HttpDeliveryMethods.GetRequest),
UserAuthorizationEndpoint =
new MessageReceivingEndpoint("https://www.google.com/accounts/
OAuthAuthorizeToken",
HttpDeliveryMethods.AuthorizationHeaderRequest |
HttpDeliveryMethods.GetRequest),
AccessTokenEndpoint =
new MessageReceivingEndpoint("https://www.google.com/accounts/
OAuthGetAccessToken", HttpDeliveryMethods.AuthorizationHeaderRequest |
HttpDeliveryMethods.GetRequest),
TamperProtectionElements =
new ITamperProtectionChannelBindingElement[] { new
HmacSha1SigningBindingElement() },
};



public void StartOAuth()
{
var consumer = new WebConsumer(GoogleConsumer.ServiceDescription,
new InMemoryTokenManager("user", "pass"));
// Url to redirect to
var authUrl = new Uri("http://www.google.com");
// request access

consumer.Channel.Send(consumer.PrepareRequestUserAuthorization(authUrl,
null, null));

throw new NoRedirectToAuthPageException();
}
Reply all
Reply to author
Forward
0 new messages