Hi Team!
I am having some issues with the OAuthv2/Authentik combo.
I set up my seahub_settings.py
file this way:
ENABLE_OAUTH = True
OAUTH_CREATE_UNKNOWN_USER = True
OAUTH_ACTIVATE_USER_AFTER_CREATION = True
OAUTH_ENABLE_INSECURE_TRANSPORT = True
OAUTH_CLIENT_ID = "xxxxx"
OAUTH_CLIENT_SECRET = "xxxx"
OAUTH_REDIRECT_URL = "https://drive.example.com/oauth/callback/"
OAUTH_PROVIDER_DOMAIN = "id.example.com"
OAUTH_AUTHORIZATION_URL = "https://id.example.com/application/o/authorize/"
OAUTH_TOKEN_URL = "https://id.example.com/application/o/token/"
OAUTH_USER_INFO_URL = "https://id.example.com/application/o/userinfo/"
OAUTH_SCOPE = ["openid", "profile", "email"]
OAUTH_ATTRIBUTE_MAP = {
"id": (False, "not used"),
"name": (False, "name"),
"email": (True, "email"),
}
And this is my Authentik configuration:
Provider:
Authorization flow: default-provider-authorization-implicit-consent (Authorize Application)
Redirect URIs/oOrigins: Strict, https://drive.example.com/oauth/callback/
Application:
Name: seafile
Slig: seafile
Launch URL: https://drive.example.com
Everything else are defaults, but whenever I try to log in with SSO I get this error:
Error, please contact administrator.
And this is the event on Authentik:
{
"asn": {
"asn": 3352,
"as_org": "XXXX",
"network": "XXXXXX"
},
"geo": {
"lat": XXXX,
"city": "XXXX",
"long": XXXX,
"country": "XX",
"continent": "XX"
},
"flow": "5cac64d74fec466aba981570812fb3c3",
"scopes": "profile openid email",
"http_request": {
"args": {
"scope": "openid profile email",
"state": "UTjEtWu2N2fhfkh3SOmiwsXgHpVY68",
"client_id": "XXXXX",
"redirect_uri": "https://drive.example.com/oauth/callback/",
"response_type": "code"
},
"path": "/application/o/authorize/",
"method": "GET",
"request_id": "716ce7a9a1de48dfb3ab0d532398bf8f",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:137.0) Gecko/20100101 Firefox/137.0"
},
"authorized_application": {
"pk": "f09bcd253d69429fb63143c6674cd58a",
"app": "authentik_core",
"name": "seafile",
"model_name": "application"
}
}
I have NO clue of what is happening.
Thanks!
EDIT: FOUND IT! It was, of course, the stupidest of things.
FILE_SERVER_ROOT and SERVICE_URL were set to:
When they should be (as I am serving it with npm):
Modified it on the adin interface and solved.