authlib / authlib/authlib

Add environment variable support for `server_metadata_url`

Open
#797 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.4k
Forks
563
PR merge metrics
No merged PRs in 30d

Description

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

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

```text
{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:

```text
{name}_SERVER_METADATA_URL: Server metadata discovery endpoint URL
```

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

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.