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

Why get_authorization_code_scopes is called before validate_code? #719

Open
Alemmi opened this issue Mar 7, 2020 · 1 comment
Open

Why get_authorization_code_scopes is called before validate_code? #719

Alemmi opened this issue Mar 7, 2020 · 1 comment
Labels
Discussion OAuth2-Provider This impact the provider part of OAuth2 OIDC OpenID Connect

Comments

@Alemmi
Copy link

Alemmi commented Mar 7, 2020

The validator function get_authorization_code_scopes is called before validate_code, and it is not logical. Why?

  • I'm using OIDC
  • I'm writing server side
@JonathanHuot
Copy link
Member

Hi @Alemmi,

I think that's related to a oauthlib design issue when doing OIDC.
oauthlib needs the "scope" to determine if we have "openid" in it. If yes, it calls the OpenID flow, else it calls the OAuth2 flow. That's the Dispatcher.

Any PRs welcome to improve the situation, but it will involves to find another mechanism to replace the Dispatcher.

If oauthlib remains as it is, I'd recommand to implement both functions, but get_authorization_code_scopes do the actual validation but returns [] if the code is invalid, and validate_code only return the validation status done at the previous callback.

@JonathanHuot JonathanHuot added Discussion OAuth2-Provider This impact the provider part of OAuth2 OIDC OpenID Connect labels Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion OAuth2-Provider This impact the provider part of OAuth2 OIDC OpenID Connect
Projects
None yet
Development

No branches or pull requests

2 participants