claims-based-identity

Adding claims to Azure AD authentication

你离开我真会死。 提交于 2021-02-11 14:06:38
问题 I am right now using Microsoft Authentication with Owin and Azure AD. I want to add a custom claim (not one of the optional ones you can choose in AAD), and be able to assign my own value to this claim, before login with Microsoft, so the claim gets associated with my Authentication login with Microsoft. This is because I want to be able to access this claim at a later stage in my application after login. Is this possible? 来源: https://stackoverflow.com/questions/62532800/adding-claims-to

Blazor - Securing using ADFS with local DB repository: how/when to hook into SQL

痞子三分冷 提交于 2021-02-11 13:38:17
问题 I have a Blazer Server app which now uses authentication from a local ADFS server. Having identified the user, I now need to load their permissions. We don't think this can be provided via claims from the ADFS server, so want to configure this in the DB, but need to understand how/when to get this information. Regarding the hook into ADFS, my code is as follows (any suggestions on improvement most welcome) App.razor <CascadingAuthenticationState> <Router AppAssembly="@typeof(Program).Assembly

How to cast UserStore<IdentityUser> to its base class IUserStore<IUser>?

寵の児 提交于 2021-02-11 07:10:37
问题 I am trying to use the new asp.net identity provider with my abstraction layer of my models domain, wich have a implementation of Entity Framework, so I would like to use the out of box version of identity with entity framework in my data access layer. How can I convert an UserStore<IdentityUser> to its base interface IUserStore<IUser> Once UserStore is an implementation of IUserStore, I can get the cast by this: UserStore<IdentityUser> as IUserStore<IdentityUser> But I want to avoid the

SignOut of claims authentication

ε祈祈猫儿з 提交于 2021-01-29 20:27:35
问题 I have successfully implemented claims authentication in to my project. As shown here: var userCredentials = new[] { new Claim("UserId", userProfile.UserId.ToString()), new Claim("Username", userProfile.UserName)}; var id = new ClaimsIdentity(userCredentials, "Forms"); var cp = new ClaimsPrincipal(id); var token = new SessionSecurityToken(cp); var sam = FederatedAuthentication.SessionAuthenticationModule; sam.WriteSessionTokenToCookie(token); Which is working correctly, the issue I'm trying

Azure AD with Single Page Application and ASP.Net core web api: how to access all relevant tokens?

时间秒杀一切 提交于 2021-01-29 13:40:22
问题 Our application is an Angular SPA with ASP.Net Core Web API. The identity is provided by Microsoft Identity Platform (Azure AD) and authentication is provided by the same. The authorization is done in Web API basis "Application Roles". These "Application Roles" are held in the Azure AD directory (defined in the Application's manifest and assigned on the tenant domain to users). The Angular SPA receives the tokens from Azure, as per these instructions. The relevant tokens that are issued are:

How to configure Windows authentication for custom binding in WCF service?

帅比萌擦擦* 提交于 2021-01-29 04:06:24
问题 I need to use Windows authentication in my application along with claim-based authorization using Windows Identity Foundation. I have used following configuration for my service. <system.identityModel> <identityConfiguration> <claimsAuthorizationManager type="Framework.Authorization.AuthorizationManager, ClaimsAuthorizationService"/> </identityConfiguration> </system.identityModel> <system.serviceModel> <bindings> <customBinding> <binding name="CustomTcpBinding" maxConnections="50"

Owin claims - Add multiple ClaimTypes.Role

霸气de小男生 提交于 2021-01-16 08:11:58
问题 I have an application in which users can be assigned the following roles: SuperAdmin Admin User One user may have assigned two or more roles, eg. both SuperAdmin and User. My application uses claims, and therefore i want to authenticate user roles through claims too. like: [Authorize(Roles="Admin")] Unfortunately, i dont know how i can add multiple roles to my ClaimTypes.Role. I have the following code: var identity = new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, name), new Claim

User.Identity.Name is null after federated Azure AD login with aspnetcore 2.2

元气小坏坏 提交于 2020-12-25 04:48:06
问题 I've followed AzureAD aspnetcore sample as closely as possible to try and implement Azure AD authentication in our aspnetcore 2.2 webapp. I am able to login successfully using Azure AD. However, the user's name is not being displayed AFTER login. https://github.com/Azure-Samples/active-directory-b2c-dotnetcore-webapp This value should be read in the view from the User.Identity.Name property. On further inspection, I can see that the principal claims are being correctly returned to the