ModenaN1
ModenaN1
LLangfuse
Created by ModenaN1 on 8/15/2024 in #self-host-support
SSO with KeyCloak Error
Hi!! I've installed Langfuse in my self-hosted environment and configured a Custom OAuth provider (KeyCloak deployed in the same docker network) with errors. I just deploy it with docker-compose:
langfuse:
image: langfuse/langfuse:2
depends_on:
db:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://${DB_USERNAME:-postgres}:${DB_PASSWORD}@db:5432/langfuse
- NEXTAUTH_SECRET=${SECRET_KEY}
- SALT=${SECRET_KEY}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
- NEXTAUTH_URL=langfuse.mydomain.com
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
- AUTH_CUSTOM_CLIENT_ID=${AUTH_CUSTOM_CLIENT_ID}
- AUTH_CUSTOM_CLIENT_SECRET=${AUTH_CUSTOM_CLIENT_SECRET}
- AUTH_CUSTOM_ISSUER=https://sso.mydomain.com
- AUTH_CUSTOM_NAME=KeyCloak
- AUTH_CUSTOM_ALLOW_ACCOUNT_LINKING=true
langfuse:
image: langfuse/langfuse:2
depends_on:
db:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://${DB_USERNAME:-postgres}:${DB_PASSWORD}@db:5432/langfuse
- NEXTAUTH_SECRET=${SECRET_KEY}
- SALT=${SECRET_KEY}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
- NEXTAUTH_URL=langfuse.mydomain.com
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
- AUTH_CUSTOM_CLIENT_ID=${AUTH_CUSTOM_CLIENT_ID}
- AUTH_CUSTOM_CLIENT_SECRET=${AUTH_CUSTOM_CLIENT_SECRET}
- AUTH_CUSTOM_ISSUER=https://sso.mydomain.com
- AUTH_CUSTOM_NAME=KeyCloak
- AUTH_CUSTOM_ALLOW_ACCOUNT_LINKING=true
Langfuse is exposed by a reverse-proxy (nginx), and when I access langfuse and click on "KeyCloak" button the page reload with this URL and this error in the docker log:
https://langfuse.mydomain.com/auth/sign-in?callbackUrl=https%3A%2F%2Flangfuse.mydomain.com%2Fauth%2Fsign-in&error=OAuthSignin
https://langfuse.mydomain.com/auth/sign-in?callbackUrl=https%3A%2F%2Flangfuse.mydomain.com%2Fauth%2Fsign-in&error=OAuthSignin
[next-auth][error][SIGNIN_OAUTH_ERROR]
https://next-auth.js.org/errors#signin_oauth_error Unable to find matching target resource method {
error: {
message: 'Unable to find matching target resource method',
name: 'OPError'
},
providerId: 'custom',
message: 'Unable to find matching target resource method'
}
[next-auth][error][SIGNIN_OAUTH_ERROR]
https://next-auth.js.org/errors#signin_oauth_error Unable to find matching target resource method {
error: {
message: 'Unable to find matching target resource method',
name: 'OPError'
},
providerId: 'custom',
message: 'Unable to find matching target resource method'
}
It's possible to integrate with a custom provider like KeyCloak (standard OAuth2 flows) ? PD: The client_id & client_secret used here, are used by others apps in the same docker network and works fine. Thank u!!
7 replies