authlib icon indicating copy to clipboard operation
authlib copied to clipboard

Add environment variable support for `server_metadata_url`

Open kimminw00 opened this issue 4 months ago • 0 comments

Is your feature request related to a problem? Please describe.

Currently, authlib supports the following environment variables for OAuth configurations:

{name}_CLIENT_ID
{name}_CLIENT_SECRET
{name}_REQUEST_TOKEN_URL
{name}_REQUEST_TOKEN_PARAMS
{name}_ACCESS_TOKEN_URL
{name}_ACCESS_TOKEN_PARAMS
{name}_AUTHORIZE_URL
{name}_AUTHORIZE_PARAMS
{name}_API_BASE_URL
{name}_CLIENT_KWARGS

However, when working with OIDC providers that support discovery endpoints (like .well-known/openid-configuration), we need to manually configure the server_metadata_url in code rather than through environment variables.

Describe the solution you'd like It would be great if authlib could also support:

{name}_SERVER_METADATA_URL: Server metadata discovery endpoint URL

Reference https://docs.authlib.org/en/stable/client/flask.html#configuration

kimminw00 avatar Aug 14 '25 04:08 kimminw00