Open samuelbarata opened 4 days ago
What's the type of external OAuth source you use? If it's a standard OpenID OAuth, there should be a sub
in its token data, if not, you might need to create a OAuth Source Property Mapping
to set its sub
attribute.
@j-z10 the token url
simply provides the token for the Profile URL
to get the user information
{"access_token": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "refresh_token": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "token_type": "Bearer", "expires_in": 21600}
From the Profile URL
I get the username
, name
and email
What should I map to the sub
property? username
? What other properties do I need to map?
Current property mapping is:
return {
"sub": data.get("username"),
"exp": data.get("expires_in"),
"email_verified": True,
"uid": data.get("username"),
"username": data.get("username"),
"email": data.get("email"),
"name": data.get("name"),
"given_name": data.get("givenNames"),
"preferred_username": data.get("username"),
"nickname": data.get("givenNames"),
}
And I still get the same error:
Authentication failed: Could not determine id.
sorry it's my mistake, the OAuth source mapping only works after the source connection is successfully created.
As you can see here, the info is the user's profile, which is the response data from your source.profile_url
. if there isn't a sub
in its original profile data, then it might not be a valid OpenID OAuth Source.
What I want I'm trying to setup a login with an external oAuth source.
What I have done
default-authentication-identification
added that sourceWhat happens When I first click the button I'm redirected and I perform the login I get the error message from authentik:
Relevant info I didn't create mappings since the JSON provided by the OAuth provider shares the same names as authentik:
Screenshots
Logs
Version and Deployment:
Additional context
AUTHENTIK_LOG_LEVEL=trace