Log works again, but keycloak login page still appears twice.

This commit is contained in:
2021-04-29 12:44:48 +02:00
parent 7b52bfba88
commit 9228270b80
3 changed files with 10 additions and 31 deletions

View File

@@ -6,15 +6,15 @@ import { TRAVEL_API_URL, USER_API_URL } from '../app.config';
export function configureAuth(oidcConfigService: OidcConfigService): () => Promise<any> {
return () =>
oidcConfigService.withConfig({
stsServer: 'https://okupamicoche-keycloak:8443/auth/realms/okupamicoche',
stsServer: 'http://okupamicoche-keycloak:8080/auth/realms/okupamicoche',
// stsServer: 'https://okupamicoche-keycloak:8443/auth/realms/okupamicoche',
redirectUrl: window.location.origin,
postLogoutRedirectUri: window.location.origin,
clientId: 'okupamicoche-frontend-angular',
scope: 'openid profile',
responseType: 'code',
silentRenew: true,
// useRefreshToken: true,
silentRenewUrl: `${window.location.origin}/silent-renew.html`,
useRefreshToken: true,
renewTimeBeforeTokenExpiresInSeconds: 30,
tokenRefreshInSeconds: 20,
ignoreNonceAfterRefresh: true, // Keycloak's refresh token fails if Nonce is not ignored

View File

@@ -114,13 +114,13 @@ export class ChatService {
await this.matrixClient.startClient({ initialSyncLimit: 100 });
// this.matrixClient.once('sync', (state: string, prevState: string, _: any) => {
// if (state === 'PREPARED') {
// console.log('CHAT SYNC FINISHED');
// } else {
// console.log('MATRIX CLIENT STATE CHANGED state=' + state);
// }
// });
this.matrixClient.once('sync', (state: string, prevState: string, _: any) => {
if (state === 'PREPARED') {
console.log('CHAT SYNC FINISHED');
} else {
console.log('MATRIX CLIENT STATE CHANGED state=' + state);
}
});
return this.matrixClient;
}

View File

@@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<base href="./" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>silent-renew</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<script>
window.onload = function () {
/* The parent window hosts the Angular application */
var parent = window.parent;
/* Send the id_token information to the oidc message handler */
var event = new CustomEvent('oidc-silent-renew-message', { detail: window.location });
parent.dispatchEvent(event);
};
</script>
</body>
</html>