azure-functions-openapi-extension icon indicating copy to clipboard operation
azure-functions-openapi-extension copied to clipboard

How can I specify the ClientID and Scopes for an OIDC auth?

Open situssoft opened this issue 3 years ago • 3 comments

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<string, string> { { $"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

situssoft avatar Apr 21 '22 16:04 situssoft

Hi, The same question occurs to me, have you resolved it?

Zyysurely avatar Aug 25 '22 12:08 Zyysurely

Hi, Anyone found a solution for this?

mohdemraan avatar Dec 21 '22 03:12 mohdemraan