claims-based-identity

MVC 5 OWIN login with claims and AntiforgeryToken. Do I miss a ClaimsIdentity provider?

拟墨画扇 提交于 2019-12-03 06:51:16
问题 I'm trying to learn Claims for MVC 5 OWIN login. I try'ed to keep it as simple as possible. I started with the MVC template and inserted my claims code (see below). I get an error when I use the @Html.AntiForgeryToken() helper in the View. Error: A claim of type 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' or 'http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovid er' was not present on the provided ClaimsIdentity. To enable anti-forgery

POCO's with the new ASP.NET Identity and MVC 5.0 + claims-based Identity

倖福魔咒の 提交于 2019-12-03 05:58:46
With the new version of VS 2013 RTM and asp.net mvc 5.0, I’ve decided to try out a few things... Needless to say, a lot has changed. For example, the new ASP.NET Identity is a replacement of the old Membership and (less old) SimpleMembership APIs. In all previous applications I’ve built, I never had the chance to work with Membership or with SimpleMembership. I’ve always ended up creating my own Login() method which would convert a submitted ViewModel to a POCO (using automapper) which in turn, would use some sort of repository to lookup the user and password. In return, I would obtain a User

ASP.NET Core - Add role claim to User

时光怂恿深爱的人放手 提交于 2019-12-03 05:17:49
问题 I've an ASP.NET Core (based on .NET Framework) using Windows Authentication. Point is, I need to add a role claim on that user and this role is stored in a distant database. I've read so much thing about OWIN/Cookie/UserManager/UserStore/Identity and so on that I'm lost. Question : How do I add a role claim for current user logged in (windows) for the whole application in the easiest way? What I need is to easily use [Authorize(Role= "MyAddedRole")] or bool res = User.IsInRole("MyAddedRole")

How do I create a ClaimsIdentity object for Asp.NET MVC 5?

不羁的心 提交于 2019-12-03 04:50:15
问题 I am working in a .NET MVC 5 application. I do not want to use Entity Framework. I want to authenticate to a RavenDB database. It looks to me that I want to replace the UserManager that comes with the Account Controller. I think I can rewrite all the UserManager functions to work with my database, except I don't understand the ClaimsIdentity object. In the SignInAsync method, there is a call to UserManager.CreateIdentityAsync(...) . I know it returns a ClaimsIdentity object. What I don't know

Message: ID4243: Could not create a SecurityToken. A token was not found in the token cache and no cookie was found in the context

匆匆过客 提交于 2019-12-03 03:31:41
We're getting the exact same error as in this thread ... in our production environment. [ WIF Security Token Caching Does anybody have a fix to this error ? Message: ID4243: Could not create a SecurityToken. A token was not found in the token cache and no cookie was found in the context. Here is some info about our setup: • We‘re using built-in Windows Identity Framework with .NET Framework 4.5.1 • The problem is almost always associated with changing from RelyingParty#X over to RelyingParty#Y ( e.g. the moment user clicks the RP#Y he‘s SIGNED OUT without asking for it ) – when he logs in

Is it possible to get ACS claims without editing web.config?

自闭症网瘾萝莉.ら 提交于 2019-12-03 03:10:05
Is it possible to set up the realm URL, claim types, etc for azure ACS without editing the web.config? Can you set up these required elements programmatically somehow? EDIT: Specifically I want to get rid of this: <federatedAuthentication> <wsFederation passiveRedirectEnabled="true" issuer="https://mynamespace.accesscontrol.windows.net/v2/wsfederation" realm="http://localhost:81/" requireHttps="false" /> </federatedAuthentication> Basically, I don't want the realm being specified in the web config, but rather in code somewhere. I've tried overriding ClaimsAuthenticationManager and commenting

Users Roles Permissions using ASP.NET Core Identity 3

a 夏天 提交于 2019-12-03 00:27:39
I'm stuck on a solution that I would like to provide in an asp.net mvc core application. I would like to provide a solution to the standard User, Roles, Permissions in a web application leveraging the new Claims based approach. I've been following Ben Foster's logic here ( http://benfoster.io/blog/asp-net-identity-role-claims ). In the code below (demo quality) I illustrate my methodology which I will comment to help show my quick and dirty test solution. The challenge I have is, that its not working. //NOTE: I have found the bug and will comment where I went wrong for future users looking for

Federated authentication in Sharepoint 2013: getting rtFa and FedAuth cookies

[亡魂溺海] 提交于 2019-12-02 21:06:47
The scenario is the following: I need to perform a federated authentication of a user (which uses his university account) into the Sharepoint site of his university and to obtain both the FedAuth and rtFa cookies (which I have to pass to SharePoint REST webservices in order to access resources). I made some attempts but there is at least an issue in each one: 1) Using Microsoft.SharePoint.Client library ClientContext context = new ClientContext(host); SharePointOnlineCredentials creds = new SharePointOnlineCredentials(user, passw); context.Credentials = creds; Uri sharepointuri = new Uri(host)

MVC 5 OWIN login with claims and AntiforgeryToken. Do I miss a ClaimsIdentity provider?

寵の児 提交于 2019-12-02 19:27:00
I'm trying to learn Claims for MVC 5 OWIN login. I try'ed to keep it as simple as possible. I started with the MVC template and inserted my claims code (see below). I get an error when I use the @Html.AntiForgeryToken() helper in the View. Error: A claim of type 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' or 'http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovid er' was not present on the provided ClaimsIdentity. To enable anti-forgery token support with claims-based authentication, please verify that the configured claims provider is

How do I create a ClaimsIdentity object for Asp.NET MVC 5?

怎甘沉沦 提交于 2019-12-02 19:09:39
I am working in a .NET MVC 5 application. I do not want to use Entity Framework. I want to authenticate to a RavenDB database. It looks to me that I want to replace the UserManager that comes with the Account Controller. I think I can rewrite all the UserManager functions to work with my database, except I don't understand the ClaimsIdentity object. In the SignInAsync method, there is a call to UserManager.CreateIdentityAsync(...) . I know it returns a ClaimsIdentity object. What I don't know is how to create a ClaimsIdentity object on my own. I see that it has 4 properties Actor ,