I have an (https-only) API that uses OAuth2 for authentication and authorization via access tokens.
Any request to the API needs an access token to the Authorization header. The API validates that this access token is signed by a specific tenant (e.g. google), is targeted to a specific audience, and has some specific scopes.
As a user/service, it would be really helpful if the API would expose, on a public endpoint, such information, so that I know from where I should fetch an access token from (e.g. through PKCE), and which scopes I need to request the token from.
A natural mechanism for this is for the API to have a public endpoint with something like
{
"provider_uri": "https://accounts.google.com/.well-known/openid-configuration",
"client_id":"...apps.googleusercontent.com",
"scope":"openid ..."
}
Is this a valid approach? What other relevant idioms exist to address such problem?