Skip to content

20210609 auth grant code token#2

Open
mcgrof wants to merge 2 commits intojeffmahoney:mainfrom
mcgrof:20210609-auth-grant-code-token
Open

20210609 auth grant code token#2
mcgrof wants to merge 2 commits intojeffmahoney:mainfrom
mcgrof:20210609-auth-grant-code-token

Conversation

@mcgrof
Copy link
Copy Markdown

@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 <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>
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