RFC: Unify OAuth 2.0 API #994
pilcrowonpaper
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We recently introduced experimental
createOAuth2AuthorizationUrl()
(+ PKCE version) andvalidateOAuth2AuthorizationCode()
, and I think it's a pretty well defined API that makes everything easier. However, types likeOAuthProvider
is loosely defined and aren't strictly enforced. This RFC aims to create 2 unified API for OAuth 2.0 and OAuth 2.0 with PKCE. This shouldn't affect those using the helpers and mostly is intended to clean up internal code. This makes documenting API much easier as well.This is going to be a minor breaking change.
Provider Auth
ProviderUserAuth
is a regular class and that will be extended (e.g.GithubUserAuth
). The major difference is thatProviderUserAuth.existingUser
is replaced withProviderUserAuth.getExistingUser()
.OAuth 2.0
OAuth2Provider
is an abstract class. See #993 for an implementation example.OAuth 2.0 with PKCE
OAuth2ProviderWithPKCE
is an abstract class. See #993 for an implementation example.Breaking changes
ProviderUserAuth.existingUser
withProviderUserAuth.getExistingUser()
LichessAuth.getAuthorizationUrl()
will returnurl, code verifier, state
instead ofurl, state, code verifier
Beta Was this translation helpful? Give feedback.
All reactions