msal

How to acquire a token with Azure AD and MSAL in ASP.NET

两盒软妹~` 提交于 2021-02-11 14:18:29
问题 I'm trying to authenticate a token using Azure AD. In a console application , I have no problem with this thanks to IConfidentialClientApplication: static void Main(string[] args) { Console.WriteLine("Making the call..."); RunAsync().GetAwaiter().GetResult(); } private static async Task RunAsync() { AuthConfig config = AuthConfig.ReadJsonFromFile("appsettings.json"); IConfidentialClientApplication app; app = ConfidentialClientApplicationBuilder.Create(config.ClientId) .WithClientSecret(config

Azure: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:unable to find valid certification path toRequestedTarget

♀尐吖头ヾ 提交于 2021-02-11 12:29:37
问题 We have an application hosted on intranet and we are trying to configure Azure SSO for the same. The login page is getting redirected to Microsoft login portal and we are receiving the authorization Code. But when we try to post a request back to Microsoft to gain the token, we get this particular error. **sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

How to migrate a UWP app's authentication from OneDrive SDK to Graph

假如想象 提交于 2021-02-11 06:51:51
问题 So I have this really old UWP app that has been using the Live/OneDrive SDK to provide authentication and identification for at least 7 years now. The app is registered with Microsoft Account Authentication which provides a Client Id and Client Secret to identify the app when an authentication request is made. When I use the SDK for authentication (OnlineIdAuthenticationProvider), it returns a unique Id (CurrentAccountSession.UserId) with which I can determine which of my users is using the

How to use oAuth State parameter on MSAL.NET

こ雲淡風輕ζ 提交于 2021-02-10 22:20:40
问题 I am trying to make usage of the state parameter which exists in OAuth2.0 authorization flow on a .NET Core project, using MSAL 4.0 but I couldn`t find a way to do it. I want to provide/append a custom value (Redirect the user back to the Uri where they clicked the sign-in button, after AuthN succeeds). To do that, I would also need to send the current Uri in 'state' and retrieve the state value back, but I don't see any method/property on AuthenticationResult.cs that would hold it. So, how

How to use oAuth State parameter on MSAL.NET

旧时模样 提交于 2021-02-10 22:10:26
问题 I am trying to make usage of the state parameter which exists in OAuth2.0 authorization flow on a .NET Core project, using MSAL 4.0 but I couldn`t find a way to do it. I want to provide/append a custom value (Redirect the user back to the Uri where they clicked the sign-in button, after AuthN succeeds). To do that, I would also need to send the current Uri in 'state' and retrieve the state value back, but I don't see any method/property on AuthenticationResult.cs that would hold it. So, how

Use KeyVaultClient with MSAL Token “Unauthorized”

眉间皱痕 提交于 2021-02-10 18:50:50
问题 How can a desktop application use Azure AD to read KeyVault secrets? I am able to acquire a MSAL token but handing it to KeyVaultClient always results in: Microsoft.Azure.KeyVault.Models.KeyVaultErrorException: Operation returned an invalid status code 'Unauthorized' I'm not even sure KeyVault supports this kind of token but in my Googling I've seen examples of the older ADAL tokens being used. My KeyVault has access policies for both my Azure AD account and a group I'm a member of. The

How to retrieve user roles from Azule AD MSAL accessToken?

 ̄綄美尐妖づ 提交于 2021-02-10 15:43:13
问题 I created two applications in Azure portal: one is client app, and another one is web api. I'm getting accessToken in SPA and then using this token to make requests to web api. I created roles for web api app and then assigned one of these roles to myself. Inside web api I can verify user roles for every endpoint using decorators [Authorize(Roles = "Reader, Editor, Admin")] , but I also need access to these roles in my client application. I checked this accessToken using jwt.ms and it has

Active Directory B2C Redirect URI With Angular App

柔情痞子 提交于 2021-02-10 14:37:03
问题 We are using the MSAL service with an Angular App we built to use our AD B2C Login and Authentication. The problem we are running into is that the Angular App has many routes, several of them are parameterized and can have n number of possibilities. We set up the MSAL Service in our Angular like: B2CAccessTokenKey = 'b2c.access.token'; tenantConfig = { tenant: 'deepdivebioportal.onmicrosoft.com', clientID: 'xxxxxx-xxxx-xxxx-xxxx-xxxxx', signInPolicy: 'B2C_1_signin', signUpPolicy: 'B2C_1

Can Azure AD (work) accounts be used with Azure B2C? Is that a bad idea? [closed]

霸气de小男生 提交于 2021-02-07 20:56:45
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . Improve this question I need to support work accounts (or school accounts) with AzureAD B2C. I already have an existing base of Facebook clients and Google. However, when I configure the Microsoft endpoint, I only get the liveID option. Is there a way to use a custom B2C signup

Can Azure AD (work) accounts be used with Azure B2C? Is that a bad idea? [closed]

这一生的挚爱 提交于 2021-02-07 20:50:30
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . Improve this question I need to support work accounts (or school accounts) with AzureAD B2C. I already have an existing base of Facebook clients and Google. However, when I configure the Microsoft endpoint, I only get the liveID option. Is there a way to use a custom B2C signup