Disable strictDiscoveryDocumentValidation as some OIDC providers don't follow this

This commit is contained in:
Amelia 2025-06-29 22:27:08 +02:00
parent 0b64ea1622
commit 5480df4cfb
No known key found for this signature in database
GPG key ID: D6D0ECE365407EAA
2 changed files with 6 additions and 0 deletions

View file

@ -7,6 +7,8 @@ import {OidcPublicConfig} from "../admin/_models/oidc-config";
import {AccountService} from "./account.service"; import {AccountService} from "./account.service";
import {takeUntilDestroyed} from "@angular/core/rxjs-interop"; import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
import {take} from "rxjs/operators"; import {take} from "rxjs/operators";
import {ToastrService} from "ngx-toastr";
import {translate} from "@jsverse/transloco";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -17,6 +19,7 @@ export class OidcService {
private readonly httpClient = inject(HttpClient); private readonly httpClient = inject(HttpClient);
private readonly accountService = inject(AccountService); private readonly accountService = inject(AccountService);
private readonly destroyRef = inject(DestroyRef); private readonly destroyRef = inject(DestroyRef);
private readonly toastR = inject(ToastrService);
baseUrl = environment.apiUrl; baseUrl = environment.apiUrl;
@ -52,6 +55,7 @@ export class OidcService {
showDebugInformation: !environment.production, showDebugInformation: !environment.production,
responseType: 'code', responseType: 'code',
scope: "openid profile email roles offline_access", scope: "openid profile email roles offline_access",
strictDiscoveryDocumentValidation: false,
}); });
this._settings.set(oidcSetting); this._settings.set(oidcSetting);
this.oauth2.setupAutomaticSilentRefresh(); this.oauth2.setupAutomaticSilentRefresh();
@ -75,6 +79,7 @@ export class OidcService {
}, },
error: error => { error: error => {
console.log(error); console.log(error);
this.toastR.error(translate("oidc.error-loading-info"))
} }
}); });
}) })

View file

@ -13,6 +13,7 @@
"oidc": { "oidc": {
"title": "OpenID Connect Callback", "title": "OpenID Connect Callback",
"login": "Back to login screen", "login": "Back to login screen",
"error-loading-info": "An error occurred loading OpenID Connect info, contact your administrator",
"settings": { "settings": {
"save": "{{common.save}}", "save": "{{common.save}}",
"notice": "Notice", "notice": "Notice",