sources/oauth: fix github provider not including correct base scopes
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> #2047
This commit is contained in:
parent
e57b6f2347
commit
8f44c792ac
|
@ -3,6 +3,16 @@ from typing import Any
|
||||||
|
|
||||||
from authentik.sources.oauth.types.manager import MANAGER, SourceType
|
from authentik.sources.oauth.types.manager import MANAGER, SourceType
|
||||||
from authentik.sources.oauth.views.callback import OAuthCallback
|
from authentik.sources.oauth.views.callback import OAuthCallback
|
||||||
|
from authentik.sources.oauth.views.redirect import OAuthRedirect
|
||||||
|
|
||||||
|
|
||||||
|
class GitHubOAuthRedirect(OAuthRedirect):
|
||||||
|
"""GitHub OAuth2 Redirect"""
|
||||||
|
|
||||||
|
def get_additional_parameters(self, source): # pragma: no cover
|
||||||
|
return {
|
||||||
|
"scope": ["read:user", "user:email"],
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class GitHubOAuth2Callback(OAuthCallback):
|
class GitHubOAuth2Callback(OAuthCallback):
|
||||||
|
@ -24,6 +34,7 @@ class GitHubType(SourceType):
|
||||||
"""GitHub Type definition"""
|
"""GitHub Type definition"""
|
||||||
|
|
||||||
callback_view = GitHubOAuth2Callback
|
callback_view = GitHubOAuth2Callback
|
||||||
|
redirect_view = GitHubOAuthRedirect
|
||||||
name = "GitHub"
|
name = "GitHub"
|
||||||
slug = "github"
|
slug = "github"
|
||||||
|
|
||||||
|
|
Reference in New Issue