adal

AzureAD JWT Token Audience claim prefix makes JWT Token invalid

早过忘川 提交于 2021-02-18 11:16:28
问题 I'm using the 'adal-node' npm package to authenticate with an AzureAD. This is all working fine and I get a token back. However, the when examining the 'aud' claim in the JWT token I see the audience GUID is prefixed with 'spn:'. I think this is causing me problems when I try to use the JWT token on an already existing Web API. When I authenticate via a WebApp using the same AzureAD the 'aud' claim is NOT prefixed with 'spn:' and I am able to called endpoints on the WebAPI. Can anyone shed

How to access Graph API from Web API in SPA application

♀尐吖头ヾ 提交于 2021-02-18 05:20:29
问题 I have an Angular application that talks to the WebAPI and the users are authenticated against Azure Active Directory I followed the sample here https://github.com/Azure-Samples/active-directory-angularjs-singlepageapp-dotnet-webapi and was able to authenticate user against AD and pass that along to the Web API. However I want to access the Graph API in the Web API and get the current user profile information. How can I set it up? Updated to give more context on the setup: I have a web site

I want to call Token API from Microsoft graph in angular 7+ http call

久未见 提交于 2021-02-11 13:39:40
问题 From angular application i want to call https://login.microsoftonline.com/##tenant##/oauth2/v2.0/token api to get access token from http call and using that token i want to call https://graph.microsoft.com/v1.0/users/##UserId##​​​​​​​​​​​​​/getMemberGroups API without using any npm package of angular. I tried using http service, but getting below error Access to XMLHttpRequest at 'https://login.microsoftonline.com/xxxx/oauth2/v2.0/token' from origin 'https://xxx.co' has been blocked by CORS

Security token from TokenValidatedContext from the OnTokenValidated event listener is missing last string segment

那年仲夏 提交于 2021-02-10 07:48:17
问题 I'm using the Microsoft.AspNetCore.Authentication.JwtBearer and System.IdentityModel.Tokens.Jwt for my .NET Core project. Whenever I generate a new token I store that to the database. First of all this is how I generate a new token public string GenerateToken(Dictionary<string, object> payload) { DateTime tokenExpiresAt = DateTime.Now.AddMilliseconds(1); // from config byte[] symmetricKey = Convert.FromBase64String("secret"); // from config SymmetricSecurityKey symmetricSecurityKey = new

run additional logic besides [Authorize] annotation

不想你离开。 提交于 2021-02-10 00:34:54
问题 I'm using the Microsoft.AspNetCore.Authentication.JwtBearer and System.IdentityModel.Tokens.Jwt for my .NET Core project. Whenever I generate a new token I store that to the database. When a user signs out, I remove it from the database to invalidate it (I also remove the expired ones from the database with a job). When a user tries to access a route protected by the [Authorize] annotation I want to check if that token exists in the database. If not, I send a 401. In my Startup in the

run additional logic besides [Authorize] annotation

不羁岁月 提交于 2021-02-10 00:14:30
问题 I'm using the Microsoft.AspNetCore.Authentication.JwtBearer and System.IdentityModel.Tokens.Jwt for my .NET Core project. Whenever I generate a new token I store that to the database. When a user signs out, I remove it from the database to invalidate it (I also remove the expired ones from the database with a job). When a user tries to access a route protected by the [Authorize] annotation I want to check if that token exists in the database. If not, I send a 401. In my Startup in the

run additional logic besides [Authorize] annotation

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-10 00:12:44
问题 I'm using the Microsoft.AspNetCore.Authentication.JwtBearer and System.IdentityModel.Tokens.Jwt for my .NET Core project. Whenever I generate a new token I store that to the database. When a user signs out, I remove it from the database to invalidate it (I also remove the expired ones from the database with a job). When a user tries to access a route protected by the [Authorize] annotation I want to check if that token exists in the database. If not, I send a 401. In my Startup in the

run additional logic besides [Authorize] annotation

好久不见. 提交于 2021-02-10 00:07:43
问题 I'm using the Microsoft.AspNetCore.Authentication.JwtBearer and System.IdentityModel.Tokens.Jwt for my .NET Core project. Whenever I generate a new token I store that to the database. When a user signs out, I remove it from the database to invalidate it (I also remove the expired ones from the database with a job). When a user tries to access a route protected by the [Authorize] annotation I want to check if that token exists in the database. If not, I send a 401. In my Startup in the

Hide back button in Azure Active Directory login page

大憨熊 提交于 2021-02-08 02:11:16
问题 We have implemented ADAL js in our angular web app. I wonder if Is there any config to hide the back ('Atrás' in the picture) button at the login page? to be like: 回答1: No, there's not option to hide the "back" button. 来源: https://stackoverflow.com/questions/57810154/hide-back-button-in-azure-active-directory-login-page

Hide back button in Azure Active Directory login page

怎甘沉沦 提交于 2021-02-08 02:10:17
问题 We have implemented ADAL js in our angular web app. I wonder if Is there any config to hide the back ('Atrás' in the picture) button at the login page? to be like: 回答1: No, there's not option to hide the "back" button. 来源: https://stackoverflow.com/questions/57810154/hide-back-button-in-azure-active-directory-login-page