[java-idp-plugin-webauthn] branch main updated: Change userHandle to userId in credential creation options
Phil Smart
philip.smart at jisc.ac.uk
Mon Feb 19 11:59:12 UTC 2024
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch main
in repository java-idp-plugin-webauthn.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-webauthn.git;a=commit;h=8e4798ac4b50545a6d325bae87283f35cae35b99
The following commit(s) were added to refs/heads/main by this push:
new 8e4798a Change userHandle to userId in credential creation options
8e4798a is described below
commit 8e4798ac4b50545a6d325bae87283f35cae35b99
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Mon Feb 19 11:59:09 2024 +0000
Change userHandle to userId in credential creation options
---
.../admin/CredentialCreationOptionsParameters.java | 24 +++++++++++-----------
.../CredentialCreationOptionsParametersTest.java | 8 ++++----
.../CreatePublicKeyCredentialCreationOptions.java | 2 +-
.../impl/YubicoWebauthnAuthenticationClient.java | 2 +-
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java
index f2ace6e..1d00ad8 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java
@@ -53,8 +53,8 @@ public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
/** The requirement on registering a ResidentKey. Also know as a discoverable credential.*/
@Nonnull final ResidentKeyRequirement residentKeyRequirement;
- /** The userhandle supplied to the authenticator during registration. As generated by the IdP.*/
- @Nonnull final byte[] userHandle;
+ /** The user.id supplied to the authenticator during registration. As generated by the IdP.*/
+ @Nonnull final byte[] userId;
/** The Attestation conveyance preference.*/
@Nonnull private final AttestationConveyancePreference attestationConveyancePreference;
@@ -73,7 +73,7 @@ public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
this.username = Constraint.isNotEmpty(builder.username, "Username can not be null or empty");
this.residentKeyRequirement = Constraint.isNotNull(builder.residentKeyRequirement,
"Resident key requirement can not be null");
- this.userHandle = Constraint.isNotNull(builder.userHandle, "UserHandle can not be null");
+ this.userId = Constraint.isNotNull(builder.userId, "UserID can not be null");
this.authenticatorAttachment = builder.authenticatorAttachment;
this.attestationConveyancePreference = Constraint.isNotNull(builder.attestationConveyancePreference,
"AttestationConveyancePreference can not be null");
@@ -120,12 +120,12 @@ public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
/**
- * Get the user handle.
+ * Get the user.id.
*
* @return the userHandle
*/
- @Nonnull public final byte[] getUserHandle() {
- return userHandle;
+ @Nonnull public final byte[] getUserId() {
+ return userId;
}
/**
@@ -214,12 +214,12 @@ public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
/** Stage interface.*/
public interface IUserHandleStage {
/**
- * The userhandle supplied to the authenticator during registration. As generated by the IdP.
+ * The user.id supplied to the authenticator during registration. As generated by the IdP.
*
- * @param userHandle the user handle
+ * @param userHauserIdndle the user.id
* @return the next stage
*/
- public IAttestationConveyancePreferenceStage withUserHandle(@Nonnull final byte[] userHandle);
+ public IAttestationConveyancePreferenceStage withUserId(@Nonnull final byte[] userId);
}
@@ -277,7 +277,7 @@ public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
private ResidentKeyRequirement residentKeyRequirement;
/** The userhandle supplied to the authenticator during registration. As generated by the IdP.*/
- private byte[] userHandle;
+ private byte[] userId;
/** The AuthenticatorAttachment requirement. {@code null} would represent either possibility.*/
private AuthenticatorAttachment authenticatorAttachment;
@@ -323,8 +323,8 @@ public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
}
@Override
- public IAttestationConveyancePreferenceStage withUserHandle(@Nonnull final byte[] userHandle) {
- this.userHandle = userHandle;
+ public IAttestationConveyancePreferenceStage withUserId(@Nonnull final byte[] userId) {
+ this.userId = userId;
return this;
}
diff --git a/webauthn-api/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParametersTest.java b/webauthn-api/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParametersTest.java
index e1a6418..21c9e4e 100644
--- a/webauthn-api/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParametersTest.java
+++ b/webauthn-api/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParametersTest.java
@@ -40,7 +40,7 @@ public class CredentialCreationOptionsParametersTest {
.withExcludeCredentials(CollectionSupport.emptySet())
.withUsername("username")
.withResidentKeyRequirement(ResidentKeyRequirement.DISCOURAGED)
- .withUserHandle(new byte[0])
+ .withUserId(new byte[0])
.withAttestationConveyancePreference(AttestationConveyancePreference.NONE)
.withAuthenticatorAttachment(AuthenticatorAttachment.CROSS_PLATFORM)
.build();
@@ -57,7 +57,7 @@ public class CredentialCreationOptionsParametersTest {
.withExcludeCredentials(CollectionSupport.emptySet())
.withUsername(null)
.withResidentKeyRequirement(ResidentKeyRequirement.DISCOURAGED)
- .withUserHandle(new byte[0])
+ .withUserId(new byte[0])
.withAttestationConveyancePreference(AttestationConveyancePreference.NONE)
.withAuthenticatorAttachment(AuthenticatorAttachment.CROSS_PLATFORM)
.build();
@@ -72,7 +72,7 @@ public class CredentialCreationOptionsParametersTest {
.withExcludeCredentials(CollectionSupport.emptySet())
.withUsername("username")
.withResidentKeyRequirement(ResidentKeyRequirement.DISCOURAGED)
- .withUserHandle(null)
+ .withUserId(null)
.withAttestationConveyancePreference(AttestationConveyancePreference.NONE)
.withAuthenticatorAttachment(AuthenticatorAttachment.CROSS_PLATFORM)
.build();
@@ -87,7 +87,7 @@ public class CredentialCreationOptionsParametersTest {
.withExcludeCredentials(null)
.withUsername("username")
.withResidentKeyRequirement(ResidentKeyRequirement.DISCOURAGED)
- .withUserHandle(new byte[0])
+ .withUserId(new byte[0])
.withAttestationConveyancePreference(AttestationConveyancePreference.NONE)
.withAuthenticatorAttachment(AuthenticatorAttachment.CROSS_PLATFORM)
.build();
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java
index 2b2e245..99b7e17 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java
@@ -138,7 +138,7 @@ public class CreatePublicKeyCredentialCreationOptions extends AbstractWebAuthnRe
.withUsername(username)
.withResidentKeyRequirement(residentKeyRequirement)
// Set the userId as the user handle
- .withUserHandle(userId)
+ .withUserId(userId)
.withAttestationConveyancePreference(attestationPreference)
.withAuthenticatorAttachment(
context.getAuthenticatorAttachmentRequirement())
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClient.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClient.java
index bc485a5..d0ef7b0 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClient.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClient.java
@@ -118,7 +118,7 @@ public class YubicoWebauthnAuthenticationClient implements WebAuthnAuthenticatio
final UserIdentity identity =
UserIdentity.builder().name(creationOptions.getUsername())
.displayName(creationOptions.getUsername())
- .id(new ByteArray(creationOptions.getUserHandle()))
+ .id(new ByteArray(creationOptions.getUserId()))
.build();
final PublicKeyCredentialCreationOptions creation = PublicKeyCredentialCreationOptions.builder()
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list