feat: add support for OAuth 2.0 Authorization Server Issuer Identification

This commit is contained in:
Elias Schneider
2025-07-06 15:29:26 +02:00
parent 49f1ab2f75
commit bf042563e9
5 changed files with 22 additions and 17 deletions

View File

@@ -48,4 +48,5 @@ export type OidcDeviceCodeInfo = {
export type AuthorizeResponse = {
code: string;
callbackURL: string;
issuer: string;
};

View File

@@ -57,8 +57,8 @@
await oidService
.authorize(client!.id, scope, callbackURL, nonce, codeChallenge, codeChallengeMethod)
.then(async ({ code, callbackURL }) => {
onSuccess(code, callbackURL);
.then(async ({ code, callbackURL, issuer }) => {
onSuccess(code, callbackURL, issuer);
});
} catch (e) {
errorMessage = getWebauthnErrorMessage(e);
@@ -66,12 +66,13 @@
}
}
function onSuccess(code: string, callbackURL: string) {
function onSuccess(code: string, callbackURL: string, issuer: string) {
success = true;
setTimeout(() => {
const redirectURL = new URL(callbackURL);
redirectURL.searchParams.append('code', code);
redirectURL.searchParams.append('state', authorizeState);
redirectURL.searchParams.append('iss', issuer);
window.location.href = redirectURL.toString();
}, 1000);