adal

Azure - AD - AcquireTokenSilent giving error failed_to_acquire_token_silently

时光怂恿深爱的人放手 提交于 2020-01-23 01:42:55
问题 We are using Azure AD to authenticate and get the refreshed access token every 30 mins. We invoke below method which acquires security token and add it to request header. var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value; var authContext = new AuthenticationContext(Authority, new NaiveSessionCache(userObjectId)); var credential = new ClientCredential(ConfigurationManager.AppSettings["ida:ClientId"], ConfigurationManager

Adal & Adal-Angular - refresh token infinite loop

别等时光非礼了梦想. 提交于 2020-01-15 03:26:20
问题 I've setup the adal and adal-angular v.1.0.10 libraries with my SPA application with mostly great success. I am using webpack, but reference these in my html page in hopes of avoiding global scope issues (though I'd like it to be a dependency). Everything works until the browser attempts to open an iframe to acquire a refresh token, and each iframe opens another iframe inside itself. It logs no errors, and I can't find an explanation as to what I'm doing wrong. So I'm forced to only run the

Acquiring new access token using refresh token adal js

瘦欲@ 提交于 2020-01-14 14:27:12
问题 I am working with an application that authenticate in azure ad. I use adal.js to acquire access token. But the access token is only valid for 1 hour. So how can I acquire new token behind the scene using my refresh token in Adal js? Appreciate if you can provide sample code. 回答1: As long as the user have an active session with Azure AD, ADAL JS does it automatically for you. ADAL JS examines the projected expiration of the existing token (in the cache) and if the token is about to expire, it

Why isn't my Azure Mobile Service accepting the bearer token ADAL.js is sending it?

为君一笑 提交于 2020-01-14 13:57:09
问题 I am using ADAL.js with implicit flow to authenticate an AngularJS app to be able to access an Azure Mobile Services API. I have set up Azure AD identity information in the Identity tab of the AMS (azure mobile service) as follows... The app url is set to: https://<>.azure-mobile.net/login/aad The client id is the client id from the application set up in the Azure AD. The allowed tenant is: <>.onmicrosoft.com The header is included in the GET request: Authorization: Bearer eyJ0eXAiOiJKV1Qi...

Calling Graph API through ViewModel in MVC Web App

亡梦爱人 提交于 2020-01-14 13:50:07
问题 I'm trying to use Graph API to create my own "User Profile" section of the navbar of my web app. To do this I have an AJAX call to a GetUser Action of my UserProfile Controller: $.ajax({ type: "GET", url: "@Url.Action("GetUser", "UserProfile", null)", dataType: "json", success: function (data, status, xhr) { console.log("in AJAX"); $(".img-circle, .user-image").attr("src", data.Picture); $("#user-menu-expanded").text(data.User.DisplayName + " - " + data.User.JobTitle); $("#user-menu-spinner")

How to validate token in Azure AD with Python

本秂侑毒 提交于 2020-01-14 05:49:29
问题 I have registered two apps following this Azure AD demo from step1 to step 4. And I git cloned Azure AD demo and ran it successfully. But I want to request my custom API, so I replace the resource ,but i get something wrong. The resource URI appears like http://<talent-id>/TodoListDaemon . Now, I have two questions: How do I set up a true resource? How extra work in my custom api 回答1: To validate the token you can use PyJWT and cryptography to support the RS256 algorithm. For fetching

Authenticate with ADFS inside Console App silently

ⅰ亾dé卋堺 提交于 2020-01-13 10:15:59
问题 I have a c# console application that references the ADAL.net library (Microsoft.IdentityModel.Clients.ActiveDirectory version 2.19.208020213) The purpose of the console app is to consume a HTTP endpoint which is protected with ADFS. The implementation of the ADFS auth is as follows.... var uc = new UserCredential("user", "password"); var ctx = new AuthenticationContext("https://sts.example.com/adfs", false); var token = ctx.AcquireToken(ClientResourceUri, ClientId, uc); The call to

What is the difference between ADAL.js and MSAL.js?

巧了我就是萌 提交于 2020-01-12 13:56:52
问题 I am trying to handle authentication for my app which uses Microsoft Graph. What is the difference between these two libraries? Active Directory Authentication Library for JavaScript (ADAL.js) Microsoft Authentication Library for JavaScript (MSAL.js) Is ADAL.js just an Angular 1 library of MSAL.js? 回答1: MSAL.js works with the AzureAD V2 endpoint, whereas ADAL.js works with the AzureAD V1 endpoint. The V1 endpoint supports work accounts, but not personal accounts. The V2.0 endpoint is the

Retrieve SAML using ADAL library

♀尐吖头ヾ 提交于 2020-01-07 08:38:11
问题 Can adal.js library or adal-node.js library can be used to retrieve SAML2 token from Azure AD? If so, how? I've tried using the example provided here. Although the solution works, I was not able to integrate it with express. 回答1: The short answer is NO: ADAL.JS does not support SAML2 tokens 来源: https://stackoverflow.com/questions/48168426/retrieve-saml-using-adal-library

Azure AD B2C Specify multiple Identity Providers in Xamarin.Forms iOS app

倾然丶 夕夏残阳落幕 提交于 2020-01-07 03:06:49
问题 I have used the following sample iOS project as provided here. The sample is pretty straight forward and I can get ADAL to load the login view and request user authentication, all good. Now, I intend to take it a little further by showing a login view with multiple identity providers (G+, Twitter, Fb, etc). In a web application, I can see multiple identity providers when I request for authentication as we can specify the policies in the web.config like so: <add key="ida:Tenant" value=