mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-09 15:02:05 -03:30
Add webauthn for organization authenticator when org is selected
Closes #44735 (cherry picked from commit 7be37f1e0dbab2aa8437eaeb3f2edeae9c963a15) Signed-off-by: rmartinc <rmartinc@redhat.com>
This commit is contained in:
parent
fec5110e40
commit
797bd2221c
@ -364,6 +364,10 @@ public class OrganizationAuthenticator extends IdentityProviderAuthenticator {
|
||||
form.addError(new FormMessage("Your email domain matches the " + organization.getName() + " organization but you don't have an account yet."));
|
||||
}
|
||||
|
||||
// user is null, setup webauthn data if enabled
|
||||
if (webauthnAuth.isPasskeysEnabled()) {
|
||||
webauthnAuth.fillContextForm(context);
|
||||
}
|
||||
context.challenge(form.createLoginUsername());
|
||||
}
|
||||
|
||||
|
||||
@ -107,6 +107,23 @@ public class PasskeysOrganizationAuthenticationTest extends AbstractWebAuthnVirt
|
||||
|
||||
appPage.assertCurrent();
|
||||
|
||||
events.expectLogin()
|
||||
.user(user.getId())
|
||||
.detail(Details.USERNAME, user.getUsername())
|
||||
.detail(Details.CREDENTIAL_TYPE, WebAuthnCredentialModel.TYPE_PASSWORDLESS)
|
||||
.detail(WebAuthnConstants.USER_VERIFICATION_CHECKED, "true")
|
||||
.assertEvent();
|
||||
|
||||
logout();
|
||||
events.clear();
|
||||
|
||||
// login forcing the organization
|
||||
oauth.scope("organization:email");
|
||||
oauth.openLoginForm();
|
||||
WaitUtils.waitForPageToLoad();
|
||||
|
||||
appPage.assertCurrent();
|
||||
|
||||
events.expectLogin()
|
||||
.user(user.getId())
|
||||
.detail(Details.USERNAME, user.getUsername())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user