AzureFunctionsOpenIDConnectAuthSample icon indicating copy to clipboard operation
AzureFunctionsOpenIDConnectAuthSample copied to clipboard

Ability to extend configuration

Open Riadhoq opened this issue 2 years ago • 0 comments

Hi @bryanknox , excellent work on this. I saw an issue raised to create a Nuget package for this, which will be awesome! Before publishing could you make the package extensible so that the developers are responsible for providing IssuerUrl and ClientId etc. I'm running into an issue where my issuer has a mismatch, because of the ending slash. Even when I removed the slash from the Issuer in my config, looks like you are appending a backslash at the end.

image

Also, I think people should be able to add their own Token Validation option, can you do something like the following pattern, using Action to extend the default functionality?

services.AddOidcAuthentication(options => {
                    options.ClientId = $"{ClientId}";
                    options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters
                    {
                        ValidateIssuer = true,
                        ValidIssuer = ${IssuerUrl}
                        ValidAudience = $"{ClientId}",                 
                    }}
                })

Riadhoq avatar May 17 '22 14:05 Riadhoq