Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticate client within the ClientMixin #34

Closed
jimmy-lt opened this issue Mar 4, 2018 · 1 comment
Closed

Authenticate client within the ClientMixin #34

jimmy-lt opened this issue Mar 4, 2018 · 1 comment

Comments

@jimmy-lt
Copy link
Contributor

jimmy-lt commented Mar 4, 2018

From RFC6749: "The authorization server MAY accept any form of client authentication meeting its security requirements.".

However given a client query and a request object, the authlib.specs.rfc6749.authenticate_client.authenticate_client function tries to apply multiple authentication methods to the client hopping that one of them will succeed. But the actual authentication method to use is not known and may be application specific.

I think that authentication should be delegated to the client itself (authlib.specs.rfc6749.models.ClientMixin) and developers will implement the correct authentication method depending of the type of client.

Common helpers can be provided through.

@lepture
Copy link
Owner

lepture commented Mar 5, 2018

The design of authenticate_client is based on RFC7591, which will be implemented later. Each grant type can have its own client authentication methods, e.g.

  1. authorization_code accepts confidential client and public client
  2. implicit accepts only public client
  3. others accept only confidential client

If you take a look into grants, you will find that there is a TOKEN_ENDPOINT_AUTH_METHODS. If you need to design another mean of authentication, you can register_authenticate_method and use this method in each grant type.

@lepture lepture closed this as completed Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants