Azure / Azure/azure-functions-openapi-extension
How can I specify the ClientID and Scopes for an OIDC auth?
- Dominant language
- C#
- Stars
- 388
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
When using Swashbuckle.AspNetCore.Swagger I amd able to specify the ClientId to pre-fill the auth form:
`app.UseSwaggerUI(o => o.OAuthClientId(Configuration["SwaggerUI:ClientId"]));`
I can further specify the scopes to send with that request:
```
Flows = new OpenApiOAuthFlows
{
Implicit = new OpenApiOAuthFlow
{
AuthorizationUrl = new Uri("https://login.microsoftonline.com/common/oauth2/v2.0/authorize"),
Scopes = new Dictionary { { $"api://{clientId}/access_as_user", "" } }
}
}
```
I can't figure out how to do that when using this library for my functions App - can you give any guidance?
Thanks
Contributor guide
Research direction
Begin at the Functions app's OpenAPI configuration and compare its exposed entry points with the mentioned UseSwaggerUI OAuthClientId and OpenApiOAuthFlows/OpenApiOAuthFlow setup. Done means establishing a supported way to provide both the OIDC client ID and requested scopes, or documenting that the capability is unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, openapi
- Domain
- api, authentication, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100