lepture / authlib

The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
https://authlib.org/
BSD 3-Clause "New" or "Revised" License
4.49k stars 448 forks source link

RFC7591 Registration client API #526

Open azmeuk opened 1 year ago

azmeuk commented 1 year ago

authlib implements RFC7591 so one can built authorization servers with dynamic client registration. However it seems there is nothing implemented to actually register a client.

I suggest adding a parameters to BaseOAuth.register:

That way a dynamic registration could be achieved this way:

oauth = OAuth()
oauth.register(
    name="foobar",
    server_metadata_url="https://auth.mydomain.tld/.well-known/openid-configuration",
    registration_token="my-super-secret",
    client_name="foobar",
    redirect_uris=url_for("oauth.authorize", _external=True),
    ...
)

I suppose we should also think of the way to implement RFC7592 too.

What do you think? Do you have better implementation suggestions?