OIDC: Log in (#11199)
* add delegatedauthentication to validated server config * dynamic client registration functions * test OP registration functions * add stubbed nativeOidc flow setup in Login * cover more error cases in Login * tidy * test dynamic client registration in Login * comment oidc_static_clients * register oidc inside Login.getFlows * strict fixes * remove unused code * and imports * comments * comments 2 * util functions to get static client id * check static client ids in login flow * remove dead code * OidcRegistrationClientMetadata type * navigate to oidc authorize url * exchange code for token * navigate to oidc authorize url * navigate to oidc authorize url * test * adjust for js-sdk code * login with oidc native flow: messy version * tidy * update test for response_mode query * tidy up some TODOs * use new types * add identityServerUrl to stored params * unit test completeOidcLogin * test tokenlogin * strict * whitespace * tidy * unit test oidc login flow in MatrixChat * strict * tidy * extract success/failure handlers from token login function * typo * use for no homeserver error dialog too * reuse post-token login functions, test * shuffle testing utils around * shuffle testing utils around * i18n * tidy * Update src/Lifecycle.ts Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * tidy * comment * update tests for id token validation * move try again responsibility * prettier * use more future proof config for static clients * test util for oidcclientconfigs * rename type and lint * correct oidc test util * store issuer and clientId pre auth navigation * adjust for js-sdk changes * update for js-sdk userstate, tidy * update MatrixChat tests * update tests --------- Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
parent
186497a67d
commit
7b3d0ad209
7 changed files with 490 additions and 67 deletions
|
@ -316,13 +316,17 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
// the first thing to do is to try the token params in the query-string
|
||||
// if the session isn't soft logged out (ie: is a clean session being logged in)
|
||||
if (!Lifecycle.isSoftLogout()) {
|
||||
Lifecycle.attemptTokenLogin(
|
||||
Lifecycle.attemptDelegatedAuthLogin(
|
||||
this.props.realQueryParams,
|
||||
this.props.defaultDeviceDisplayName,
|
||||
this.getFragmentAfterLogin(),
|
||||
).then(async (loggedIn): Promise<boolean | void> => {
|
||||
if (this.props.realQueryParams?.loginToken) {
|
||||
// remove the loginToken from the URL regardless
|
||||
if (
|
||||
this.props.realQueryParams?.loginToken ||
|
||||
this.props.realQueryParams?.code ||
|
||||
this.props.realQueryParams?.state
|
||||
) {
|
||||
// remove the loginToken or auth code from the URL regardless
|
||||
this.props.onTokenLoginCompleted();
|
||||
}
|
||||
|
||||
|
@ -341,7 +345,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
// if the user has followed a login or register link, don't reanimate
|
||||
// the old creds, but rather go straight to the relevant page
|
||||
const firstScreen = this.screenAfterLogin ? this.screenAfterLogin.screen : null;
|
||||
|
||||
const restoreSuccess = await this.loadSession();
|
||||
if (restoreSuccess) {
|
||||
return true;
|
||||
|
|
|
@ -477,6 +477,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
|
|||
this.props.serverConfig.delegatedAuthentication!,
|
||||
flow.clientId,
|
||||
this.props.serverConfig.hsUrl,
|
||||
this.props.serverConfig.isUrl,
|
||||
);
|
||||
}}
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue