sources: add property mappings for all oauth and saml sources (#8771)

Co-authored-by: Jens L. <jens@goauthentik.io>
This commit is contained in:
Marc 'risson' Schmitt
2024-08-07 19:14:22 +02:00
committed by GitHub
parent 78bae556d0
commit 83b02a17d5
64 changed files with 3631 additions and 314 deletions

View File

@ -25,16 +25,6 @@ class OAuth1Callback(OAuthCallback):
def get_user_id(self, info: dict[str, str]) -> str:
return info.get("id")
def get_user_enroll_context(
self,
info: dict[str, Any],
) -> dict[str, Any]:
return {
"username": info.get("screen_name"),
"email": info.get("email"),
"name": info.get("name"),
}
@registry.register()
class OAUth1Type(SourceType):
@ -50,6 +40,13 @@ class OAUth1Type(SourceType):
profile_url = "http://localhost:5001/api/me"
urls_customizable = False
def get_base_user_properties(self, info: dict[str, Any], **kwargs) -> dict[str, Any]:
return {
"username": info.get("screen_name"),
"email": info.get("email"),
"name": info.get("name"),
}
class TestSourceOAuth1(SeleniumTestCase):
"""Test OAuth1 Source"""