1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

add claims to completeauhtorizationcodegrant response (#3765)

This commit is contained in:
Kerry
2023-10-04 17:05:54 +13:00
committed by GitHub
parent 2e4276437a
commit 6e8d15e5ed
2 changed files with 5 additions and 1 deletions

View File

@@ -284,6 +284,7 @@ describe("oidc authorization", () => {
expires_at: result.tokenResponse.expires_at, expires_at: result.tokenResponse.expires_at,
scope, scope,
}, },
idTokenClaims: result.idTokenClaims,
}); });
}); });
@@ -325,6 +326,7 @@ describe("oidc authorization", () => {
expires_at: result.tokenResponse.expires_at, expires_at: result.tokenResponse.expires_at,
scope, scope,
}, },
idTokenClaims: result.idTokenClaims,
}); });
expect(result.tokenResponse.token_type).toEqual("Bearer"); expect(result.tokenResponse.token_type).toEqual("Bearer");

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { Log, OidcClient, SigninResponse, SigninState, WebStorageStateStore } from "oidc-client-ts"; import { IdTokenClaims, Log, OidcClient, SigninResponse, SigninState, WebStorageStateStore } from "oidc-client-ts";
import { IDelegatedAuthConfig } from "../client"; import { IDelegatedAuthConfig } from "../client";
import { subtleCrypto, TextEncoder } from "../crypto/crypto"; import { subtleCrypto, TextEncoder } from "../crypto/crypto";
@@ -199,6 +199,7 @@ export const completeAuthorizationCodeGrant = async (
oidcClientSettings: IDelegatedAuthConfig & { clientId: string }; oidcClientSettings: IDelegatedAuthConfig & { clientId: string };
tokenResponse: BearerTokenResponse; tokenResponse: BearerTokenResponse;
homeserverUrl: string; homeserverUrl: string;
idTokenClaims: IdTokenClaims;
identityServerUrl?: string; identityServerUrl?: string;
}> => { }> => {
/** /**
@@ -250,6 +251,7 @@ export const completeAuthorizationCodeGrant = async (
tokenResponse: normalizedTokenResponse, tokenResponse: normalizedTokenResponse,
homeserverUrl: userState.homeserverUrl, homeserverUrl: userState.homeserverUrl,
identityServerUrl: userState.identityServerUrl, identityServerUrl: userState.identityServerUrl,
idTokenClaims: signinResponse.profile,
}; };
} catch (error) { } catch (error) {
logger.error("Oidc login failed", error); logger.error("Oidc login failed", error);