msal

Logout does not work when using Microsoft Authentication Library (MSAL)

随声附和 提交于 2019-12-07 19:16:29
问题 I have a Xamarin.Forms iOS/Android app and have to authenticate the user against a Microsoft Azure B2C AD. I have added the Microsoft.Identity.Client NuGet and using this for authentication. Login works fine and I am able to use the returned token to call an Azure hosted service of our own. The trouble is that when I try to logout the user it does not work as expected. If the user logs out and immediately after kills the app, the next time the app is started the login screen is presented as

access token / refresh token with MSAL

怎甘沉沦 提交于 2019-12-07 13:06:37
问题 I'm moderately familiar with OAuth2 and the concepts of the AccessToken and RefreshToken. It looks like MSAL is doing some work for us when using ClientApplicationBase.AcquireTokenSilentAsync(). I'm not clear as to whether it will always check the expiration of the current AccessToken and automatically refresh it (using the RefreshToken) on method call. Regardless, is there a "best practice" for how often we should call AcquireTokenSilentAsync() ? Should we keep track of the expiration

How to sign out from Azure AD 2.0/MSAL in a desktop application?

隐身守侯 提交于 2019-12-07 06:30:42
问题 I'm using MSAL in a WPF desktop application that needs to allow users to sign in and out against Azure AD v2.0. Microsoft's Graph access sample and most of the other examples I see use PublicClientApplication.Remove(IUser) to log out, like in this function: //(from Microsoft's example) /// <summary> /// Sign out the current user /// </summary> private void SignOutButton_Click(object sender, RoutedEventArgs e) { if (App.PublicClientApp.Users.Any()) { try { App.PublicClientApp.Remove(App

iOS ADAL-Make silent call using refresh token

旧时模样 提交于 2019-12-06 15:04:11
问题 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

On behalf of token issue (AADSTS50013: Assertion contains an invalid signature)

有些话、适合烂在心里 提交于 2019-12-06 13:39:16
I'm getting an error (mentioned below) when I'm trying to use Cortana Bot user token (which is a Graph token) to generate an "on-behalf-of" token to another consuming Web API application using ClientAssertionCertificate / ClientCredential targeted to another consuming Web API by passing its AppId as ResourceId and userAssertion generated by using Cortana Bot user token. When checked our Bot AAD settings it is configured with other consuming Web API (API B) as valid application along with Graph application. Do we need to do any additional setting in AAD to get this on-behalf-of token?

Using MSAL in a machine-to-machine scenario as a CSP

徘徊边缘 提交于 2019-12-06 11:19:32
I am trying to use the GraphAPI using the official nuget library ( https://github.com/microsoftgraph/msgraph-sdk-dotnet ). However, the authentication process is not trivial and not very well documented. I am in a CSP partner in a machine-to-machine scenario, so there is no UI application with a redirect url where a user manually enter it's credentials to consent access. But it seems to be the unique scenario well documented or available in the samples I found... Even the official CSP documentation is not clear ( https://developer.microsoft.com/en-us/graph/docs/concepts/auth

Logout does not work when using Microsoft Authentication Library (MSAL)

拈花ヽ惹草 提交于 2019-12-06 06:36:52
I have a Xamarin.Forms iOS/Android app and have to authenticate the user against a Microsoft Azure B2C AD. I have added the Microsoft.Identity.Client NuGet and using this for authentication. Login works fine and I am able to use the returned token to call an Azure hosted service of our own. The trouble is that when I try to logout the user it does not work as expected. If the user logs out and immediately after kills the app, the next time the app is started the login screen is presented as expected. To kill the app on iOS I go to app-switcher with double click home button and the swipe up.

Microsoft.AspNetCore vs Microsoft.IdentityModel (ADAL) with .net core API in Azure AD

六月ゝ 毕业季﹏ 提交于 2019-12-06 05:52:11
Cheers, I'm looking for some clarification regarding authentication libraries for use with Azure AD, particularly regarding the differences between Microsoft.AspNetCore and Microsoft.IdentityModel based libraries. I am implementing an Api in .net core for which authentication will be managed with Azure Active Directory (AAD). Based on the needs of the application I am looking to use the original (v1) endpoint with ADAL rather than the v2 endpoint due to some features not being available with the v2 endpoint at this time (RBAC and groups). All indications are that the ADAL libraries are the way

Use MSAL Auth token to consume Web API 2

断了今生、忘了曾经 提交于 2019-12-05 06:54:38
I have an ASP.Net Web API 2 on which I implemented the following security: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-devquickstarts-webapi-dotnet It worked, I can't access the controllers except if I remove the [Authorize] attribute. Now, I have a logged in user in a Xamarin app. The user is logged in via MSAL authentication which works fine too. Very basic implementation : var authenticationResult = await App.IdentityClientApp.AcquireTokenSilentAsync(App.ClientScope); var token = authenticationResult.Token; Now, I want to access the web API by giving the

Is it possible to use MSAL.js to get refresh token?

a 夏天 提交于 2019-12-05 05:20:08
I want to integrate with Miscrosoft Outlook. I am able to login with MSAL.js and get an access token, but I am not able to get a refresh token. Is there a way to do it? I'll assume that since you're using the MSAL.js ( https://github.com/AzureAD/microsoft-authentication-library-for-js ) that you're using implicit flow for authentication and authorization. Implicit flow doesn't support refresh tokens, but you can request a new token silently. This is done similarly to how you request the token (id or access) in the first place. Unfortunately, I haven't found that MSAL.js does this transparently