OIDC: register (#11727)

* update uses of ValidatedDelegatedAuthConfig to broader OidcClientConfig type

* add OIDC register flow to registration page

* pass prompt param to auth url creation

* update type

* lint

* test registration oidc button

* fix: reference state inside setState

* comment
This commit is contained in:
Kerry
2023-10-12 10:44:46 +13:00
committed by GitHub
parent a80cf58aa3
commit 5d169afb8a
7 changed files with 215 additions and 41 deletions

View File

@@ -35,11 +35,14 @@ export const startOidcLogin = async (
clientId: string,
homeserverUrl: string,
identityServerUrl?: string,
isRegistration?: boolean,
): Promise<void> => {
const redirectUri = window.location.origin;
const nonce = randomString(10);
const prompt = isRegistration ? "create" : undefined;
const authorizationUrl = await generateOidcAuthorizationUrl({
metadata: delegatedAuthConfig.metadata,
redirectUri,
@@ -47,6 +50,7 @@ export const startOidcLogin = async (
homeserverUrl,
identityServerUrl,
nonce,
prompt,
});
window.location.href = authorizationUrl;