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.
Related
I need to implement Azure AD authentication and authorization for my ASP.NET MVC web application using MSAL.NET with authorization code flow and I need to call my own API.
I can see a lot of manual code implementations on the internet to redeem authorization codes etc...
I know the latest version of MSAL.NET will handle auto code redeem without writing any manual code but how to use it, any good example will help me a lot.
Second, what are the best practices followed while using MSAL.NET with authorization code flow to call my own API?
Note: I am using the .net framework.
Thanks in advance.
This might be helpful
Microsoft.Identity.Web adds extension methods that provide convenience services for calling Microsoft Graph or a downstream web API. These methods are explained in detail in A web app that calls web APIs: Call an API. With these helper methods, you don't need to manually acquire a token.
https://learn.microsoft.com/en-us/azure/active-directory/develop/scenario-web-app-call-api-acquire-token?tabs=aspnetcore
https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow
Also you can use custom solution like below
https://identitymodel.readthedocs.io/en/latest/client/token.html
Start reading from here, it supports the following frameworks:
.Net Core
.Net framework
For MVC ensure first that u are using either Asp.net Core or normal .net framework. Once you have figured that out. You can find the relevant code which you can refer to generate the token logic.
Read here for more details about the MSAL authentication library.
MSAL authentication library for dot net
Code samples collection.
https://learn.microsoft.com/en-us/azure/active-directory/develop/sample-v2-code
We have developed an Identity Provider to perform Single sign on using SAML 2.0.
I just want to know whether Sitefinity gives support for SAML protocols ?
I came to know sitefinity supports only Claims based authentication(using WIF).
And found something in Github link below,where sitefinity can extend to 3rd party STS/IDP like Google,FB,Amazon.
But these external auth are OAuth based(i guess).
https://github.com/Sitefinity/Sitefinity-External-STS-Integration/blob/master/README.md
Is it possible to use a SAML 2 IDP for performing SSO in sitefinity CMS?
Any suggestions,resource references will be of great help.
Sitefinity does not support SAML out of the box.
For more Reference,follow the link below
http://www.sitefinity.com/developer-network/forums/developing-with-sitefinity-/does-sitefinity-support-saml-2-0
And Sitefinity still doesn't support SAML 2.0. But using a package like this one I was able to add in support pretty easily using standard MVC Controllers and Actions and such: https://www.itfoxtec.com/IdentitySaml2
(I'm not affiliated with them, just a fan.)
I want to migrate my security infrastructure to OWIN/Katana but i'm not very familiar with it. I hope someone can give me a ride in the right direction. Currently i use .net fwk 4.5, mvc 5 and the features in System.Security/IdentityModel. The authentication is done against ADFS 2.0 (i want to configure it in owin), i use claims transformation and session management (where is it placed and how it's done in owin) and authorization is done by filters (is still the same in owin?).
Thanks a lot guys!
Have a look at blog post by Vittorio Bertocci that shows how to secure webapi.
Lots of sample that can be applied to ADFS https://github.com/Azure-Samples to secure using OWIN.
Is there a de-facto solution for ASP.NET MVC 3+ one should use in case he needs to allow users to sign in/up via:
OpenID
OAuth
Trivial registration / manual authentication
?
What I'm basically looking for is "Membership API" that works for OpenID, OAuth and whatever else. Key features are:
Roles support (for ASP.NET MVC)
Ability to bind multiple auth methods to single user (for instance, somebody first signed up with "trivial registration", then he wants to bind his Google account and then his Yahoo account, so he should be able to auth with any of these 3)
Thanks!
DotNetOpenAuth is your friend.
See this blog post: OpenID Authentication with ASP.NET MVC3 , DotNetOpenAuth and OpenID-Selector
Also, you can see the official tutorial on ASP.NET MVC.
Please visit this links:- you can find a good solution....
OpenID Authentication with ASP.NET MVC3 , DotNetOpenAuth and OpenID-Selector
And you can download code from the SocialAuth-net project and modify source code and implement. I have also done this, from here.
Is there a simple example of OpenID authentication implemented using MVC ?
DotNetOpenAuth. You can also take a look at this blog post from Scott Hanselman.
RPX is yet another OpenID library.
Authenticating users with RPXNow (in ASP.NET MVC)
You cant get much simpler than this:
I just installed dotnetopenauth through nuget to a new project (forms authentication included), and then followed this tutorial which is pasting 3 small chunks of code and it worked.
http://andrewblogs.com/blog/openid-for-asp-net-mvc-a-quick-setup/
I know a im a bit late but look here
http://nuget.org/packages/SimpleID
Now i haven't tried it but it seems like the fastest solution and its based on DotNetOpenAuth
Here is a complete step by step article how to add OpenID authentication to ASP.NET MVC 3 application. It shows how to combine OpenID with stanard FormAusthenication model, so you can use either e-mail/password or OpenID.
Complete solution code is available. It worked for me with some minor tweaking to get user's e-mail, first and last name in addition to OpenID :-)
OpenID Authentication with ASP.NET MVC3 , DotNetOpenAuth and OpenID-Selector
http://weblogs.asp.net/haithamkhedre/archive/2011/03/13/openid-authentication-with-asp-net-mvc3-dotnetopenauth-and-openid-selector.aspx