claims-based-identity

asp.net mvc 5 entity framework 6 identity working with trust level = medium?

萝らか妹 提交于 2019-12-04 06:38:29
问题 Creating the simplest project (In visual studio 2013 -> asp.net web application -> MVC authentication with individual accounts), it works perfectly on localhost. However, when sending to the server (medium trust level), the project does not work when I try to enter login. See the error image: http://s18.postimg.org/fm2qw8gzt/print.png I tried to include on assembly.cs [assembly: AllowPartiallyTrustedCallers]. It did not work. I have created a strong name key. It did not work. The server does

BootstrapContext is null on ClaimsIdentity

拟墨画扇 提交于 2019-12-04 03:41:39
I have created a new ASP.NET MVC application with .NET 4.5. I have successfully set up authentication with an STS. The authentication flow is working fine and I am able to get the ClaimsIdentity, containing the desired claims, on Thread.CurrentPrincipal. Now I need the bootstrap token to secure the calls to my service layer. I have set the saveBootstrapContext to true on the identityConfiguration element. <system.identityModel> <identityConfiguration saveBootstrapContext="true"> However, the BootstrapContext property on the ClaimsIdentity is always null. var identity = Thread.CurrentPrincipal

Setting Thread.CurrentPrincipal with async/await

雨燕双飞 提交于 2019-12-04 00:59:07
问题 Below is a simplified version of where I am trying to set Thread.CurrentPrincipal within an async method to a custom UserPrincipal object but the custom object is getting lost after leaving the await even though it's still on the new threadID 10. Is there a way to change Thread.CurrentPrincipal within an await and use it later without passing it in or returning it? Or is this not safe and should never be async? I know there are thread changes but thought async/await would handle synching this

Unable to add and fetch custom claims values

孤街醉人 提交于 2019-12-03 23:33:36
问题 I am using mvc 5 with identity 2.0. I want use custom claim values over the application but I get null value. What am I doing wrong? Updated code Login Code in account controller if (!string.IsNullOrEmpty(model.UserName) && !string.IsNullOrEmpty(model.Password)) { AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); var result = SignInManager.PasswordSignIn(model.UserName, model.Password, model.RememberMe, shouldLockout: false); //Generate verification token Dictionary

WIF config: issuerNameRegistry vs. certificateValidation

巧了我就是萌 提交于 2019-12-03 22:38:56
问题 In the Windows Identity Foundation (WIF) 4.5 config, what is the relationship between issuerNameRegistry and certificateValidation ? What portion of a SAML 2.0 assertion is validated by each? For example: the code & config below will verify that the issuer cert has the given thumbprint. But I assume a certificateValidationMode other than "None" will validate some additional details? var handlers = FederatedAuthentication.FederationConfiguration.IdentityConfiguration.SecurityTokenHandlers; var

Azure ACS and storing information for users on it vs local?

余生颓废 提交于 2019-12-03 20:45:10
I'm working with Azure ACS and incorporating it into an SSO strategy for my .NET 4.0 website. I see on the Rule Groups page that a bunch of different claims can be stored and passed back to the RP (e.g. country, streetaddress, phone, etc.). It looks like you can also return back any claim type you want to create. This got me thinking about many questions relating to storing information for users: Does it make sense to store user information (other than the nameidentifier) in ACS vs local database tables? It sounded like you could make unlimited rule groups and rules inside of them. Is that

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

狂风中的少年 提交于 2019-12-03 17:03:06
问题 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

Asp.net Core Identity Use AspNetUserClaims or AspNetRoleClaims?

落花浮王杯 提交于 2019-12-03 15:41:30
问题 I am still confused about all this Identity stuff. First I am still confused the difference between Roles, Policies/Claims. From what I read roles is the old way of doing stuff and was kept for backward compatibility, so does that mean AspNetRoleClaims is part of this backward compatibility? I think I understand Claims and Policies when thinking of them individual, like policy is basically a set of rules that must pass and gives the ability to change rules without having to go through out all

A member of the System.Security.Claims namespace is not available?

旧时模样 提交于 2019-12-03 14:39:53
I am learning the new Claims-based Authentication methods in .NET 4.5, and am using a Console app to do so. According to MSDN here , ClaimsAuthenticationManager is a member of System.Security.Claims namespace. As you can see here, I am not getting this option. I have made sure the project is using .NET 4.5. I am missing something simple here... anyone have any suggestions? You need to add a reference to System.IdentityModel.dll You can see this in the documentation for ClaimsAuthenticationManager : Namespace: System.Security.Claims Assembly: System.IdentityModel (in System.IdentityModel.dll)