Log works again, but keycloak login page still appears twice.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user