Azure / Azure/Azurite

Create Mock endpoint for AAD Token Generation for Local Development

Open
#2,373 1 comment 5 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

### Which service(blob, file, queue, table) does this issue concern?
blob, file, queue and table

### Which version of the Azurite was used?
v3.29.0

### Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
Docker and Visual Studio Code Extension.

### What's the Node.js version?
Not applicable

### What problem was encountered?
For consistency reasons, the goal is to use OAuth authentication when developing locally as well as when running the code in Azure.
Therefore, we were running Azurerite with OAuth and HTTPS. Azurerite then requires passing a Bearer token to its endpoint.

In our case we were using the `azure-identity` library and the `ClientSecretCredential` classes. This however requires a valid client ID, client secret and tenant ID to be passed to the credential. For local development, this is not desired as developers should just interact with Azurite and may not even have a valid Azure Account or service principal to generate a token.

What could be done is to override the `authority` parameter of `ClientSecretCredential` to make sure it does not call `https://login.microsoftonline.com//v2.0/...` to generate a token but some mock endpoint. Now, the customer could create a mock API endpoint which creates additional effort.

The ask is whether Azurerite could offer another endpoint to mock the token generation as well to overcome the need for actual credentials when developing locally.

### Steps to reproduce the issue?

If possible, please provide the debug log using the -d parameter, replacing \ with an appropriate path for your OS, or review the instructions for docker containers:

Not applicable

### Have you found a mitigation/solution?
Today, local development has to rely on shared storage keys, which should be avoided.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.