Skip to content

Commit fc4d24c

Browse files
committed
Polish WebAuthn Authentication Builder
Issue gh-17861
1 parent 29fe5bb commit fc4d24c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

webauthn/src/main/java/org/springframework/security/web/webauthn/authentication/WebAuthnAuthentication.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ public Builder<?> toBuilder() {
8181
}
8282

8383
/**
84-
* A builder preserving the concrete {@link Authentication} type
85-
*
84+
* A builder of {@link WebAuthnAuthentication} instances
8685
* @since 7.0
8786
*/
8887
public static final class Builder<B extends Builder<B>> extends AbstractAuthenticationBuilder<B> {
@@ -94,6 +93,12 @@ private Builder(WebAuthnAuthentication token) {
9493
this.principal = token.principal;
9594
}
9695

96+
/**
97+
* Use this principal.
98+
* It must be of type {@link PublicKeyCredentialUserEntity}
99+
* @param principal the principal to use
100+
* @return the {@link Builder} for further configurations
101+
*/
97102
@Override
98103
public B principal(@Nullable Object principal) {
99104
Assert.isInstanceOf(PublicKeyCredentialUserEntity.class, principal,

0 commit comments

Comments
 (0)