Add client_uri, tos_uri and policy_uri client metadata

This commit is contained in:
Quentin Gliech 2022-04-29 16:30:24 +02:00
parent b899b347b6
commit 7aa7af4adf
No known key found for this signature in database
GPG Key ID: 22D62B84552719FC
2 changed files with 7 additions and 0 deletions

View File

@ -156,6 +156,10 @@ export class URLRouter<T extends {session: string | boolean}> implements IURLRou
return window.location.origin; return window.location.origin;
} }
absoluteAppUrl(): string {
return window.location.origin;
}
absoluteUrlForAsset(asset: string): string { absoluteUrlForAsset(asset: string): string {
return (new URL('/assets/' + asset, window.location.origin)).toString(); return (new URL('/assets/' + asset, window.location.origin)).toString();
} }

View File

@ -78,6 +78,9 @@ export class OidcApi {
return { return {
client_name: "Hydrogen Web", client_name: "Hydrogen Web",
logo_uri: this._urlCreator.absoluteUrlForAsset("icon.png"), logo_uri: this._urlCreator.absoluteUrlForAsset("icon.png"),
client_uri: this._urlCreator.absoluteAppUrl(),
tos_uri: "https://element.io/terms-of-service",
policy_uri: "https://element.io/privacy",
response_types: ["code"], response_types: ["code"],
grant_types: ["authorization_code", "refresh_token"], grant_types: ["authorization_code", "refresh_token"],
redirect_uris: [this._urlCreator.createOIDCRedirectURL()], redirect_uris: [this._urlCreator.createOIDCRedirectURL()],