DotNetOpenAuth in MVC4 - Yahoo doesn't work - oauth

I am migrating my existing project from MVC3 to MVC4. In MVC3 I used Microsoft Azure's Access Control Service (ACS) for getting user identity. I would like to use DotNetOpenAuth.AspNet that comes with VS2012 to replace the old method, and I am studying this with the sample website that VS2012 created when you start a new 'Internet Application' project.
I followed the tutorial and made the necessary changes in AuthConfig.cs, trying to enable using facebook & google & yahoo to authenticate. The facebook works ok. Both Google and yahoo don't work, and result.IsSuccessful is always false in the function ExternalLoginCallback().
I did some google search and found this site: https://github.com/mj1856/DotNetOpenAuth.GoogleOAuth2. I followed this site and finally got google work.
However, I am still stuck with the yahoo problem. I wonder if there is any similar solution for yahoo like google.
Thank you.

Sorry I didn't see this sooner. Glad you like my Google OAuth2 adapter. I wrote one for Facebook also.
I checked, but I couldn't find any support from Yahoo for OAuth2. They appear to support only OpenID or OAuth 1. You might as well us the OpenID client that ships with OAuthWebSecurity in MVC4.
OAuthWebSecurity.RegisterYahooClient();
If anyone know of Yahoo OAuth2 support, please let me know. Thanks.

Related

ASP.NET MVC authentication and credentials

I'm currently working on a simple application in ASP.NET MVC 5. I'm beginner in this. The assignment is about authentication from providers(Facebook, Google, Microsoft) and displaying user credentials from provider on a web page after logging in. I did authentication successfully, but I can't figure out exactly how to get credentials and display them. Any suggestions?
though this is not exactly an answer, but the post is likely going to be closed. There are some nice resources in the web from which you can find some ideas, please look into the following ones:
https://www.youtube.com/watch?v=WsRyvWvo4EI&list=PL6n9fhu94yhW7yoUOGNOfHurUE6bpOO2b&index=28
https://www.youtube.com/watch?v=kxLxlukWuVg&list=PL6n9fhu94yhW7yoUOGNOfHurUE6bpOO2b&index=29

How do I add Google OAuth (OpenID Connect) as an IP in Azure ACS?

Disclaimer - I am an extreme n00b when it comes to SAML, ACS and OAuth .. and just auth in general. I'm used to Windows Auth and at a push ADFS. I'm afraid you might need to give me the slow "one word a page" version here
As you are I'm sure aware Google has now deprecated the use of the OpenId 2.0 API for authentication (as of May 19th 2014). This has of course completely broken the "Google" Identity Provider (IP) in Azure Access Control Services (ACS). I basically need to add Google Support back in for a new project and understand it might be a bit more complicated than "click a few buttons".
I have seen a few blogs mention that I might need to "create an STS for the Google Auth, which I then add to ACS as the IP" but they didn't go into any more detail and I honestly don't have any idea how to do this or what it involves. I am happy to write code (I've been writing C# for almost 10 years) but have never done anything like this before.
Can anyone point me at samples / tutorials that will hopefully not go completely over my head?
The latest samples for Google+ are the ones on the Google+ Github page. Check out the .NET sample, this shows the code flows for OAuth 2.0 using Google's client libraries. There's a blog post on the key OAuth 2.0 flows in .NET as well.
If you are using MVC, there is a blog post on integrating OAuth 2.0 with Microsoft's MVC framework.
Although the samples are not targeted to Azure, I have deployed them to Azure instances without issue. If getting integrated into Azure is shown to be problematic and you think it would be worth it for Google to provide support, please request a feature in the issue tracker.
If you create a plugin, extension, etc that would be useful to other developers, please share with the Google+ developer community.

Foursquare and ASP.Net

does anybody work with foursquare api and asp.net, do you know some basic tutorial, how to set the environment, do I need some api, how can I make my app to conect to 4sq and ask something. I work with asp.net mvc2, and any clue on this would be helpful.
Thanks in advance.
There are a couple of C# libraries available for the foursquare API, you can see the complete list here:
https://developer.foursquare.com/docs/libraries.html
In terms of tutorials, you can use the interactive query viewer on the foursquare website to get a sense of the data:
https://developer.foursquare.com/docs/venues/venues.html
(click 'try it now' and it will give you an interactive query console for the api!)
You can also get a walkthrough of how to do OAuth2 authentication on the website too:
https://developer.foursquare.com/docs/oauth.html
For what it's worth, when I was first playing with the API I found it useful to test out all of my queries using cURL, then once you use a library you're already a pro.
Hope that helps?

DotNetOpenAuth and Facebook

Does anyone know of any code samples on how to use DotNetOpenAuth with Facebook using ASP.NET MVC 3 (or any version of MVC for that matter)? The samples that come with the library do not have any Facebook examples (it looks like they used to according to some posts but not anymore).
Any help would be appreciated.
Facebook uses OAuth 2.0 instead of OpenID for logins, so you must download the DotNetOpenAuth CTP in order to get the Facebook login sample. And the sample isn't for MVC, it's for web forms. But since it's all code in the code-behind anyway, you hopefully can make the translation yourself.
If you don't have your heart set on DotNetOpenAuth, you could also take a look at Windows Identity Foundation. It also supports OAuth 2.0 and Will give you the flexibility to use other authentication providers.

mvc, oauth and google / yahoo contacts

I'm new to oAuth.
What I need to do is
a) the user logs in the site using default .net membership provider
b) once he logs in he links his google/yahoo account ( what I understand is he gets a token access which should preferably never expire and I keep it in my db)
c) the user can get his google/yahoo contacts (Name, email id and if possible a unique id for each contact) using the token access
I have created a google account and have the app id and secret key.
I'm looking at dotnetopenauth samples, project templates and tools but it has lots of things and I would appreciate if someone can guide me on the right path.
Thanks and best regards
Arnab
The OAuthConsumer sample, GoogleAddressBook.aspx page, shows how to pull Google Contacts using OAuth. Note that although this sample is in web forms rather than MVC, the OAuth consumer code is entirely written in the code-behind and has no web forms-specific stuff in it, so it can be easily lifted and dropped into an MVC app without issue.
There is no equivalent Yahoo! sample that ships as part of DotNetOpenAuth.
Don't try to use the InMemoryTokenManager that the sample uses. Write your own ITokenManager implementation. The comments and docs will guide you.

Resources