Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtaining access tokens for multiple resources with Azure Entra #1484

Open
TeckTn opened this issue Nov 17, 2024 · 1 comment
Open

Obtaining access tokens for multiple resources with Azure Entra #1484

TeckTn opened this issue Nov 17, 2024 · 1 comment

Comments

@TeckTn
Copy link
Contributor

TeckTn commented Nov 17, 2024

I have a question regarding Azure Entra (formerly Azure AD) and its handling of access tokens for multiple resources. As far as I understand, Azure Entra does not allow fetching a single access token that includes scopes for multiple resources.

For example, let's say I want to access two different APIs:

  1. A custom API that requires the scope API://xxxxxxxxxxxxx/Read.All.
  2. Microsoft Graph API, which requires the scope Mail.Send.

To obtain access tokens for these two resources, it seems necessary to make two separate authentication calls — one for each resource.

Here are my questions:

  1. Does this library support a scenario where I can get a second access token silently, without requiring the user to re-authenticate, by simply changing the requested scope?
  2. If this is supported, could you provide an example or a recommended approach to achieve this?

The goal is to ensure a smooth user experience where I can fetch additional tokens for different resources without redundant user prompts.

@guillaume-chervet
Copy link
Contributor

hi @TeckTn yes, the library was built to apply this kind of scenario.

Login first and after login by relogin another oidc-client configuration but differents scope.

The demo is doing it => login in from the first page then navigate to MultiTab page and use silentlogin =>
https://black-rock-0dc6b0d03.1.azurestaticapps.net/

silent login will work soon only with the same domain than the oidc server because of third party cookies (that will be blocked).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants