dotnetopenauth

How does one generate access tokens programmatically with DotNetOpenAuth 4 so that one can use it to test a resource server?

…衆ロ難τιáo~ 提交于 2019-12-11 21:37:41
问题 I have a web application that exposes some REST services which are in turn have several hundred tests. I have secured the rest servcies using OAuth 2.0 and using DotNetOpenAuth 4. Manual testing shows this works. This breaks my tests because I do not have access tokens to pass to the REST services. The tests seed the database with the exact same data (incl. users and clients) in order to be deterministic. The tests run unattended. How can I generate access tokens using DotNetOpenAuth 4 so I

Twitter Sign in page always showing

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 18:04:18
问题 I have implemented Sign in with Twitter on my web site using DotNetOpenAuth lib using asp.net mvc 3. My problem is that every time the user click Sign-in with twitter it redirects him to a twitter page (even if he is already logged in to twitter). I saw that sites like www.pinterest.com avoids this somehow. How can I avoid the redirect to Twitter sign-in page if the user is already logged in to twitter? 回答1: This is called Sign in with Twitter. Redirect users to https://api.twitter.com/oauth

Can I configure DotNetOpenAuth request token expiration?

瘦欲@ 提交于 2019-12-11 17:34:44
问题 In our API we implemented DotNetOpenAuth (v3.4.7). We frequently receive the exception "A token in the message was not recognized by the service provider", along with this stack trace: at DotNetOpenAuth.Messaging.ErrorUtilities.VerifyProtocol(Boolean condition, String message, Object[] args) at DotNetOpenAuth.Messaging.ErrorUtilities.ThrowProtocol(String message, Object[] args) at DotNetOpenAuth.OAuth.ChannelElements.TokenHandlingBindingElement.VerifyThrowTokenTimeToLive

sreg Yahoo problems

我怕爱的太早我们不能终老 提交于 2019-12-11 16:31:41
问题 May you please look at the issue: You may test Yahoo sreg at "https://test-id.org/OP/Sreg.aspx" ID : "https://me.yahoo.com/" username: goughev@yahoo.com password: paranoid Now the problem This code work with Google but not with Yahoo sreg, becase response.GetUntrustedExtension() alwase returns null values for properties for Yahoo var opUrl = LoginCore.GetProviderUrl(provider, openId); var openIdRelyingParty = new OpenIdRelyingParty(null); var response = openIdRelyingParty.GetResponse();

How to get OAuth working with DotNetOpenAuth and Evernote?

瘦欲@ 提交于 2019-12-11 14:07:14
问题 I'm trying to write a C# ASP.NET MVC app using the DotNetOpenAuth library that connects to the Evernote Sandbox using OAuth , but I'm having trouble getting it working. My app is fine up until the callback is invoked but when I try to request the exchange of the temporary credentials in step 10 of this diagram, it fails with a 401 Unauthorized. My callback looks like this: public ActionResult OAuthCallback() { var webConsumer = CreateWebConsumer(); var accessTokenResponse = webConsumer

Get user info from token c#

心不动则不痛 提交于 2019-12-11 13:38:18
问题 i have successfully got the key token for the above oauth authentication from Google provider through their api. let us consider "access-token" is xxxii-xxxxx-xxx-xxxxx-xxxxx which has scope of https://www.googleapis.com/auth/userinfo.profile now when i hit the browser with access token for retrieving user information values has https://www.googleapis.com/oauth2/v1/userinfo?access_token=xxxii-xxxxx-xxx-xxxxx-xxxxx; i am getting responses as { "id": "XXXXXXXXXXXXXX", "name": "XXXXXXXXXXXXXXXX"

How to use DotNetOpenAuth to login to websites?

徘徊边缘 提交于 2019-12-11 13:05:43
问题 I want to do is, if the users are logged into gmail and if they go to my website they automatically get logged in. I am doing it in the following way... maybe there is a better way of doing it. In my website I have a place for uses to give their gmail address so my website knows gamil address of the registered user. So when they go to my website I want to know whether they are logged into gmail and what is their gmail address. How should I find this information using DotNetOpenAuth? I found

DotNetOpenAuth Expected IProtocolMessage message

让人想犯罪 __ 提交于 2019-12-11 12:41:21
问题 I'm trying to request an authentication token: public static void RequestAuthorization(WebConsumer consumer) { var extraParams = new Dictionary<string, string> { { "oauth_token", string.Empty}, { "oauth_callback", "http://www.ihighfive.com/" }, }; var req = consumer.PrepareRequestUserAuthorization(callback, extraParams, null); consumer.Channel.Send(req); } Problem is, when I run .PrepareRequestUserAuthorization() I get the following error Expected IProtocolMessage message but received no

DotNetOpenAuth - Message signature was incorrect

二次信任 提交于 2019-12-11 12:03:07
问题 There is already a StackOverflow post that has addressed this issue. However, it couldn't help me. So, I have written an OpenID login implementation using DotNetOpenAuth and I keep on getting "Message signature was incorrect". The funny thing is that this is happening from a PC I have at my home. At my work I'm not getting this error and it is working ok. I've tried to add in the web.config <trust level="Full" /> <httpRuntime maxQueryStringLength="20000" /> Also, I've added the null parameter

How to include AX extension in OpenID auth request using DotNetOpenAuth

天涯浪子 提交于 2019-12-11 06:22:45
问题 How to make attribute exchange request in dotnetopenauth. 回答1: If you are just trying to get standard attributes, I recommend you read about the AXFetchAsSregTransform which hides the complexity of AX and SREG attribute gathering from your site. If you are doing something custom and know what AX attributes you need to request, here is sample code: var rp = new OpenIdRelyingParty(); var request = rp.CreateRequest("=some*identifier"); var ax = new FetchRequest(); ax.Attributes.AddRequired