microsoft-identity-platform

.NET Core add Claim after AzuerAD Authentication

我们两清 提交于 2020-01-16 08:40:16
问题 My application signs in via AzureAD, but now I need to get information from the DB and then store the Role as a Claim. So my question is: How can I store the Role as Claim after authentication ? This is what I tried: var user = User as ClaimsPrincipal; var identity = user.Identity as ClaimsIdentity; identity.AddClaim(new Claim(ClaimTypes.Role, "Admin")); But when I go to another controller, the claim does not exist anymore ? Thanks 回答1: You can achieve that during the authentication , in OIDC

Not able to use identity platform within iFrame/MS Teams custom tab

孤街浪徒 提交于 2020-01-03 01:52:30
问题 I am trying to use identity platform to authenticate users into my custom app that is to be used from within MS Teams. I am aware that Teams uses iFrame to load the custom apps. So I followed the method mentioned in the FAQs - Q5. I used redirectUri property in the MSALConfig. I am using the index file provided by MS for testing purposes by calling it inside an iFrame tag. In both cases of acquireTokenSilent and acquireTokenPopup, it gets stuck at the popup window loading the redirect page.

Not able to use identity platform within iFrame/MS Teams custom tab

℡╲_俬逩灬. 提交于 2020-01-03 01:52:12
问题 I am trying to use identity platform to authenticate users into my custom app that is to be used from within MS Teams. I am aware that Teams uses iFrame to load the custom apps. So I followed the method mentioned in the FAQs - Q5. I used redirectUri property in the MSALConfig. I am using the index file provided by MS for testing purposes by calling it inside an iFrame tag. In both cases of acquireTokenSilent and acquireTokenPopup, it gets stuck at the popup window loading the redirect page.

User stays logged in after deleting from Azure AD

孤者浪人 提交于 2019-12-24 22:36:05
问题 I've set up a small ASP.NET Core v3 webapp using Microsoft.Identity.Web from https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC This works fine. But when I log in as userA and then delete this user from our Azure AD, the user stays logged in. How can I forge my app to regularly check if the user still exists or if his roles have changed? From Cookie not expiring for Azure AD auth I understand I can set OpenIdConnectOptions

Azure Active Directory - How to restrict Backend API App Registration to a specific client App Registration

北战南征 提交于 2019-12-24 15:09:06
问题 I could be completely off basis here on how this works, but this is what I'm looking to achieve. In AAD I have an App Registration called backend-api that represents an HTTP API an App Registration called frontend-app that represents some client (lets say a console app) an App Registration called another-app that represents nothing related to my solution I have a console application where I put my client ID and client secret in for frontend-app and I can request an access_token with the aud

Login from Microsoft account not working for Multitenant Azure AD application

五迷三道 提交于 2019-12-13 04:15:10
问题 I'm building multitenant SaaS web based application. Application is registered in my tenant and each customer with their office 365 subscription will get Service principal object in Azure AD. I'm having problem with login from external account (Microsoft account) in customer tenant. I created example and tried to see what I can get from access token. Sample consists from one client application (.js) that uses MSAL library to handle authentication and two APIs that have protected endpoints. I