Open
Conversation
The requests-oauthlib library provides support for different oath2 grant
types:
- :class:`oauthlib.oauth2.WebApplicationClient` (default): Authorization Code Grant
- :class:`oauthlib.oauth2.MobileApplicationClient`: Implicit Grant
- :class:`oauthlib.oauth2.LegacyApplicationClient`: Password Credentials Grant
- :class:`oauthlib.oauth2.BackendApplicationClient`: Client Credentials Grant
As oath-clientd advances forlks will likely want to extend support for
the different grant types. For now, we're using the default
Authorization Code Grant (WebApplicationClient). However, even within
the same grant type we may authenticate at first with either a URL or
a token which the web site provides to you. The token method does not
require us to channel a url request out from another agent, and so
all we do is pass the argument: code=self.authtoken, instead of
authorization_response=self.authurl, on the requests-oauthlib
fetch_token() call.
While at it, make the "url" auth method within the Authorization
Code Grant method we use the default in case the registration doesn't
have anything clearly defined.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Now that we've added token support for the Authorization Code Grant, and allowed us to retain url authentication support, enable Google as a registration method, and specify the requirements for each of the other registrations. So far google is our first token Authorization Code Grant registrar. I've tested this with my gmail account using mbsync. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds google support