Remove localhost:3000 from Keycloak redirect URIs and web origins
- Removed localhost:3000/* from redirectUris in realm-export.json - Removed localhost:3000 from webOrigins in realm-export.json - Removed localhost:3000/* from post.logout.redirect.uris - Removed localhost:3000 from keycloak-realm-import-configmap.yaml - Updated running Keycloak instance via kcadm.sh Only port 30080 is now configured for OAuth redirects.
This commit is contained in:
@@ -48,7 +48,7 @@ function LoginContent() {
|
||||
};
|
||||
|
||||
const handleSwitchAccount = () => {
|
||||
const keycloakLogoutUrl = `${process.env.NEXT_PUBLIC_KEYCLOAK_ISSUER || 'http://localhost:8080/realms/workclub'}/protocol/openid-connect/logout?redirect_uri=${encodeURIComponent(window.location.origin + '/login')}`;
|
||||
const keycloakLogoutUrl = `${process.env.NEXT_PUBLIC_KEYCLOAK_ISSUER || 'http://localhost:30808/realms/workclub'}/protocol/openid-connect/logout?redirect_uri=${encodeURIComponent(window.location.origin + '/login')}`;
|
||||
signOut({ redirect: false }).then(() => {
|
||||
window.location.href = keycloakLogoutUrl;
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ declare module "next-auth" {
|
||||
// In Docker, the Next.js server reaches Keycloak via internal hostname
|
||||
// (keycloak:8080) but the browser uses localhost:8080. Explicit endpoint
|
||||
// URLs bypass OIDC discovery, avoiding issuer mismatch validation errors.
|
||||
const issuerPublic = process.env.KEYCLOAK_ISSUER || 'http://localhost:8080/realms/workclub'
|
||||
const issuerPublic = process.env.KEYCLOAK_ISSUER || 'http://localhost:30808/realms/workclub'
|
||||
const issuerInternal = process.env.KEYCLOAK_ISSUER_INTERNAL || issuerPublic
|
||||
const oidcPublic = `${issuerPublic}/protocol/openid-connect`
|
||||
const oidcInternal = `${issuerInternal.replace(':8080', ':8081')}/protocol/openid-connect`
|
||||
|
||||
Reference in New Issue
Block a user