adal

Azure ADAL Refresh id_token

て烟熏妆下的殇ゞ 提交于 2019-12-05 18:05:58
We are developing a multi-tenant web application. Our tenants will be using Windows Azure Active Directory for authentication. We are using OWIN OpenIdConnect middleware to authenticate users. The response we receive after authentication process has id_token and authorization code. We also want to get the refresh token so that we can acquire new tokens once the id_token expires. Therefore in AuthorizationCodeReceived handler we use AcquireTokenByAuthorizationCode method in ADAL library to acquire the refresh token. The response contains id_token, access_token and refresh_token. We then

Ui-Router 404 when redirecting with ADAL

假装没事ソ 提交于 2019-12-05 08:45:35
I'm currently trying to hook in the Azure Directory Authentication Library (ADAL.JS) into UI-Router. I've got it wired in, and it redirects correctly, but it always chucks a 404 before the redirect. The redirect works, and then gets sent back to my application, which is showing the 404. I've modified the state like so: { state: 'admin', config: { url: '/admin', templateUrl: 'app/admin/admin.html', controller: 'AdminController', controllerAs: 'vm', title: 'Admin', settings: { nav: 2, content: '<i class="fa fa-lock"></i> Admin' }, requireADLogin: true } I've got it working with the normal

How to wait for 'AuthenticationContext.AcquireTokenAsync()' synchronouslly?

笑着哭i 提交于 2019-12-05 07:29:57
First of all, I'm not sure if this is important, but for the reasons mentioned by @ Simon Mourier in him answer , I'm using the EXPERIMENTAL build of ADAL, this one . In the code below, I would like to retrieve an AuthenticationResult synchronouslly, so, I will wait for completition of the authentication by AcquireTokenAsync method in a synchronous manner. This is because a boolean flag should be set after the authorization is done ( isAuthorized = true ), but tgis need to happen in a synchronous way, because if not, then I can call other methods of the class that will throw a null reference

What is the unique id for users in OpenId Connect

孤街浪徒 提交于 2019-12-05 00:46:57
问题 We have an Asp.Net 4.5 MVC app using Asp.Net Identity to manage our customer database. We are currently using Microsoft Account Authentication. We are considering using OpenId Connect so that customers with a work/school account can also sign-in Add sign-in to an .NET MVC web app. Microsoft Account Authentication returns ProviderKey as the unique id of the user who has logged in. This is mapped onto UserId in our customer database. OpenId Connect does not appear to return a ProviderKey, but

Angular 2 Authenticatication with on-prem ADFS

限于喜欢 提交于 2019-12-04 22:36:38
问题 We have decided to use Angular 2 as the framework for our new project. In trying to deal with the security aspect of things, I cannot find much on authentication with on-prem ADFS . There is plenty out there dealing with Azure AD , but that is not an option for us. Does anyone know of a way to be able to setup Angular 2 to successfully authenticate against ADFS ? 回答1: You can implement this successfully using the ng2-adal npm library, you can implement it the same way it is implemented for

Why does AcquireToken with ClientCredential fail with invalid_client (ACS50012)?

泄露秘密 提交于 2019-12-04 19:34:51
问题 Why won't my Azure AD application allow an oauth client_credentials grant? I want to use the Azure Graph API, but first I need an oauth token. To get the token, I am trying to use Microsoft.IdentityModel.Clients.ActiveDirectory aka ADAL version 1.0.3 (from NuGet). I'm using the overload of AuthenticationContext.AcquireToken that takes a ClientCredential object. (I can't use the overload that prompts the user to login because I'm writing a service, not an app.) I configured my Azure AD web

iOS ADAL-Make silent call using refresh token

会有一股神秘感。 提交于 2019-12-04 19:33:13
I am using iOS ADAL library version 2.2.6 and receiving refresh token upon successful login. Now I want to make a silent call by using this refresh token. I tried with following method but it fails to return the access token. ADAuthenticationContext *authContext; [authContext acquireTokenSilentWithResource:resourceId clientId:clientId redirectUri:redirectUri userId:strUserID //loggedIn userID completionBlock:^(ADAuthenticationResult *result){ // It alway throws an error //Please call the non-silent acquireTokenWithResource methods. if(result.error){ ADAuthenticationError *error = nil;

The user credentials are need to obtain access token. Please call the non-silent acquireTokenWithResource methods

こ雲淡風輕ζ 提交于 2019-12-04 17:49:27
I am using ADALiOS into my app for authentication. When user signIn into the app I am getting following error: "The argument 'cacheItem.scopes' is invalid. Value:(null)." and "The user credentials are need to obtain access token. Please call the non-silent acquireTokenWithResource methods" Any help would be appreciated. Thanks This might happen if keychain sharing is disabled. One of the probable solution is: Solution: Step 1: Xcode > Target > Capabilities > Keychain Sharing -> Switch to ON Step 2: add com.microsoft.adalcache into Keychain Group. Hope this helps. There is a pattern for dealing

Azure - AD - AcquireTokenSilent giving error failed_to_acquire_token_silently

倾然丶 夕夏残阳落幕 提交于 2019-12-04 15:37:09
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.AppSettings["ida:ClientSecret"]); try { var authenticationResult = authContext.AcquireTokenSilent

Access SharePoint on-premise with a token obtained from Azure AD and ADAL

对着背影说爱祢 提交于 2019-12-04 15:30:30
The Goal Access an on-premise SharePoint data with REST requests from a mobile application based on Apache Cordova using OAuth. What I have tried so far 1. Azure Mobile Services / Hybrid Connection / AAD / ADAL Similar to the blog post Access SharePoint on behalf of the user , but with an on-premise server instead of O365: Client side log-in using ADAL for Apache Cordova . Mobile Service that is connected to the on-premise server through hybrid connections. Using ADAL.net to acquire a token for the SharePoint server using the token obtained in step 1. This works fine except step three, since