I have never done an openid application before. I did see that MVC 5 has some built in oauth sign ins. I was able to get these to work no problem, as they are already built.
But I am completely unsure how to get the steam openid to work in MVC. Does anyone have some sample code of there MVC Steam OpendID stuff? Or does anyone know a good tutorial for this?
Go to Tools > Library Package Manager > Package Manager Console and type:
Install-Package Owin.Security.Providers
Open your App_Start\Startup.Auth.cs, and add:
using Owin.Security.Providers.Steam;
Then, in the ConfigureAuth method, add:
app.UseSteamAuthentication("your API key");
You can get an API key from http://steamcommunity.com/dev.
A "Steam" button should be added to your login page.
Here is an excellent tutorial on how to integrate openid with ASP.NET MVC, and it do have working code, and instructions. Please have a look and get going.
http://weblogs.asp.net/haithamkhedre/archive/2011/03/13/openid-authentication-with-asp-net-mvc3-dotnetopenauth-and-openid-selector.aspx
Hope this helps.
Related
I created my app using a template. After that i managed to connect it with an existing database. Then i tried to add Identity so that i will be able to authorise and authenticate users of the application. I tried to do that following the instructions of "shyamal parikh" in this post Adding ASP.NET MVC5 Identity Authentication to an existing project
My problem is that now i get a 401 error unless i got to solution explorer (in VS) and disable the windows authentication. But when i do that all the users have unrestricted access to the whole application.
I assume that the problem has to do with that solution that i performed but i cant comment directly there.
Can anyone give me a hint as to what i might be doing wrong?
Do you have windows authentication installed on your computer? Maybe adding that might help. Here are the instructions-
https://www.iis.net/configreference/system.webserver/security/authentication/windowsauthentication/providers/add
Also look at your event viewer, you might have some hints there.
So I have VS 2013 update 4 and I created ASP.NET MVC application from template and configured Google authentication by using UseGoogleAuthentication method and passing client ID and secret. But for some reason once I click 'Accept' button google page I'm redirected to the page I expect but there is an error 500 in the browser console and nothing on the page itself.
I read a lot of articles and enabled all required APIs in Google Developer console. But nothing seems to work for me.
Also I have another custom authentication middleware that worked just fine before and stopped working once I enabled Google. I use nuget package version 3.0.1.
If I disable my custom auth middleware Google still does not work.
Please advise.
OK, here's why should probably stay with default values. So default redirect URL is /signin-google built-in to Google middleware. And because my URL is /Account/ExternalLoginCallback I thought it was a good idea to set it when configuring GoogleOAuth2AuthenticationOptions.
Once removed CallbackPath = new PathString("Account/ExternalLoginCallback") from configuration it just worked.
im trying to implement a custom OAuth2Client for my ASP MVC4 Application so that the users can login with their doodle.com Account.
Based on this Code, i tried to give it a shot. Unfortunately, im always getting an error 400 "bad request". Any ideas on this? My Login-Urls look like this:
http://doodle.com/api1/oauth/requesttoken?oauth_callback=http%3A%2F%2Flocalhost%3A49705%2FAccount%2FExternalLoginCallback%3F__provider__%3DDoodle%26__sid__%3D81daa197e305495b916b0f347fadf1c0&oauth_consumer_key=MYKEY&oauth_nonce=557897134&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1384429618&oauth_signature=NODC1gMPquzNx9TVg2wVoaZqjlk%3d
You can find my gist here: https://gist.github.com/davidroyal/7469100
I got it working on my own. Backdraft: You have to authorize your application on every login. But for connecting your doodle.com account with an existing account in your application, its just perfect.
Please find the experimental implementation under:
https://gist.github.com/davidroyal/7469100
Is there any article or ideas how to use/move/intergrate social authentication from WebMatrix 2 to MVC 4. I've googled internet but didn't found any info about possibility to add references to WebMatrix namespaces/libraries to MVC project. I've read following article http://www.asp.net/webmatrix/tutorials/the-top-features-in-web-pages-2-developer-preview#oauthsetup and want to use WebMatrix.Security in MVC project
If you're looking to upgrade your project from simple ASP.NET Razor pages to a full MVC 4 project, I recommend moving from WebMatrix to Visual Web Developer:
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-web-developer-express
Everything you're trying to do here with the social auth libraries should work perfectly well in VS, and there are even a few NuGet packages that can make it easy. WebMatrix is meant to get you running with ASP.NET and Razor, but VS is going to give you a fuller experience.
Happy Coding!
here you will find a step by step solution to migrate webmatrix-webpages apps into asp.net mvc. check that you can find the login area - were you will figure out the social auth login too - in order to migrate it to mvc too.
information:
The Web Pages page-centric programming model supported by WebMatrix is a great way to get Web apps up and running. If you later decide that embracing ASP.NET MVC would give you more flexibility, you're covered. We’ll explain why you might choose to migrate and show you how to do it.
read the article: http://msdn.microsoft.com/en-us/magazine/hh148144.aspx
download code: http://archive.msdn.microsoft.com/mag201105ASPNET/Release/ProjectReleases.aspx?ReleaseId=5601
OAuth authentication on website now built-in, question closed
Before I reinvent the wheel, ASP.Net MVC 3 Tools Update includes an Internet Application (with Forms based login) and Intranet Application (with Active Directory login) does anyone have an MVC 3 project template, or controller/model, or Nuget package for Open ID / Facebook / MS live based logins?
I'm capable of tracking down the API libraries for Facebook, Yahoo, Google and Microsoft and building my own, but before I start from scratch, I just wanted to see if someone already had a starter project or Nuget package that implemented that form of authentication. I'd rather support that project than start my own if I could.
Thanks :-)
Dan
Try DotNetOpenAuth
Nuget.org has a gallery you can explore. Searching for OpenID and Facebook showed several packages that will likely get you close to what you want. I'm not sure you will find a package that does them all but you should be able to grab them individually and then setup something in your code to allow logins from each.
http://nuget.org/List/Search?packageType=Packages&searchCategory=All+Categories&searchTerm=openid&sortOrder=package-download-count&pageSize=10
http://nuget.org/List/Search?packageType=Packages&searchCategory=All+Categories&searchTerm=facebook&sortOrder=package-download-count&pageSize=10
Here's how someone tackled the traversing of logins to one auth store in his system....