elliotpeele / pyramid_oauth2_provider

An Oauth2 provider built on pyramid
MIT License
31 stars 16 forks source link

Authorization code flow support #18

Open tonthon opened 7 years ago

tonthon commented 7 years ago

Hi, it seems there is no support for the Authorization code grant flow https://tools.ietf.org/html/rfc6749#section-4.1

The token view doesn't support authorization_code grant_type Am I right ?

secynic commented 7 years ago

I might be wrong, but isn't this what you are looking for? https://github.com/elliotpeele/pyramid_oauth2_provider/blob/master/pyramid_oauth2_provider/views.py#L71-L133

tonthon commented 7 years ago

That's the first step of the authorization code flow. After that, the Ressource Consumer (Server side Client) should be able to query an access token with this code (D and E in the flow described here : https://tools.ietf.org/html/rfc6749#section-4.1)

secynic commented 7 years ago

Understood. It looks like the database is already setup for this tracking: https://github.com/elliotpeele/pyramid_oauth2_provider/blob/master/pyramid_oauth2_provider/models.py#L111

Re-reading your initial post, you are right. Support should be added in the oauth2_token view.