Skip to content

Commit c3236d0

Browse files
authored
Fix Auth0 OIDC integration
1 parent 25e8a52 commit c3236d0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

run-local-keycloak.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ docker build -f docker/Dockerfile -t netbird/dashboard-local:latest .
88
docker rm -f netbird-dashboard
99
docker run -d --name netbird-dashboard \
1010
-p 3000:80 -p 443:443 \
11-
-e AUTH_AUDIENCE=netbird \
11+
-e AUTH_AUDIENCE=netbird-client \
1212
-e AUTH_AUTHORITY=http://localhost:8080/realms/netbird \
13-
-e AUTH_CLIENT_ID=netbird \
13+
-e AUTH_CLIENT_ID=netbird-client \
1414
-e USE_AUTH0=false \
15-
-e AUTH_SUPPORTED_SCOPES='openid profile email' \
15+
-e AUTH_SUPPORTED_SCOPES='openid profile email api offline_access' \
1616
-e NETBIRD_MGMT_API_ENDPOINT=http://localhost:$MGMT_PORT \
1717
-e NETBIRD_MGMT_GRPC_API_ENDPOINT=http://localhost:$MGMT_PORT \
1818
netbird/dashboard-local:latest

src/index.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const config = getConfig();
1616
// Unfortunately Auth0 https://<DOMAIN>/.well-known/openid-configuration doesn't contain end_session_endpoint that
1717
// is required for doing logout. Therefore, we need to hardcode the config for auth
1818
const auth0AuthorityConfig: AuthorityConfiguration = {
19-
authorization_endpoint: config.authority + "/authorize",
20-
token_endpoint: config.authority + "/oauth/token",
21-
revocation_endpoint: config.authority + "/oauth/revoke",
22-
end_session_endpoint: config.authority + "/v2/logout",
23-
userinfo_endpoint: config.authority + "/userinfo"
19+
authorization_endpoint: new URL("authorize", config.authority).href,
20+
token_endpoint: new URL("oauth/token", config.authority).href,
21+
revocation_endpoint: new URL("oauth/revoke", config.authority).href,
22+
end_session_endpoint: new URL("v2/logout", config.authority).href,
23+
userinfo_endpoint: new URL("userinfo", config.authority).href,
2424
} as AuthorityConfiguration
2525

2626
const providerConfig = {

0 commit comments

Comments
 (0)