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

20210609 auth grant code token #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mcgrof
Copy link

@mcgrof mcgrof commented Jun 9, 2021

This adds google support

mcgrof added 2 commits June 9, 2021 10:34
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 <[email protected]>
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 <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant