Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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();
     }
Posted

1 solution

Wouldn't be better to discuss the use of DotNetOpenAuth on a forum dedicated to the library?? Such as here[^]???

Honestly, the chances of anyone who has used OpenAuth wandering by your question here are pretty slim.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900