AzureAD / microsoft-authentication-library-for-go

The MSAL library for Go is part of the Microsoft identity platform for developers (formerly named Azure AD) v2.0. It enables you to acquire security tokens to call protected APIs. It uses industry standard OAuth2 and OpenID Connect.
MIT License
218 stars 87 forks source link

How to obtain JWT token for federated identity credentials #486

Open su18915080 opened 1 month ago

su18915080 commented 1 month ago

I am new to OIDC and MSAL and I am trying to implement Client Credential Flow with federated credential for Service-to-Service authentication in AKS. For my case the Identity Provider is the AKS. I am wondering if there is example code or doc for this scenario.

I was able to get an access token from MS Identity Platform with client_id and client_secret pretty easily using the func confidential.NewCredFromSecret() and Client.AcquireTokenByCredential(). It is straight forward. But I am having a trouble to get an assertion(JWT token), issued by IdP, to exchange with access token from MS Identity Platform.

Can anybody help? Can we use this MSAL lib to achieve it?