0

Without azurite I saw that I can obtain a bearer token by preforming a restapi call with this as the guide https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-implicit-grant-flow and it works well.

I want to use the same flow with azurite.

I am able to start azurite with azurite --oauth basic --cert path/server.pem --key path/key.pem but how do I now get the correct bearer token from the azurite emulator?

(I cannot call the same host login.microsoftonline.com so what is the localhost emulator equivalent?)

1
  • According to MS-Document[learn.microsoft.com/en-us/azure/storage/common/… Azurite accepts OAuth tokens issued by Azure AD for requests. However, it doesn’t provide a local equivalent for login.microsoftonline.com to issue tokens; instead, Azurite will only validate tokens issued by Azure AD Commented Nov 12, 2024 at 2:51

1 Answer 1

0

Get oauth token from azurite emulator with rest api.

According to this MS-document

  • The Azurite emulator supports OAuth via a "basic" simulation of Azure Active Directory authentication, but it does not act as a fully functional OAuth 2.0 identity provider.
  • Consequently, there is no direct equivalent to login.microsoftonline.com or a mechanism in Azurite itself to issue OAuth tokens.

If you need get OAuth token you need use the same command as now.

Command:

azurite --oauth basic --cert path/server.pem --key path/key.pem

It performs basic authentication, like validating the incoming bearer token, checking the issuer, audience, and expiry and doesn't check the token signature or permissions.

Sign up to request clarification or add additional context in comments.

1 Comment

> If you need get OAuth token you need use the same command as now. How is this practical? This would mean that I need to generate a "production" grade token and hardcode it in my VCS to use Azurite with OAuth.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.