Skip to content

Commit 5255a43

Browse files
committed
[java]: Fix getCredentials from VirtualAuthenticator
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 94aec15 commit 5255a43

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

java/src/org/openqa/selenium/virtualauthenticator/Credential.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static Credential fromMap(Map<String, Object> map) {
6666
Object credentialId = Require.nonNull("credentialId", map.get("credentialId"));
6767
Object isResidentCredential =
6868
Require.nonNull("isResidentCredential", map.get("isResidentCredential"));
69-
Object rpId = Require.nonNull("rpId", map.get("rpId"));
69+
Object rpId = map.get("rpId");
7070
Object privateKey = Require.nonNull("privateKey", map.get("privateKey"));
7171
Object userHandle = map.get("userHandle");
7272
Object signCount = Require.nonNull("signCount", map.get("signCount"));

java/test/org/openqa/selenium/virtualauthenticator/VirtualAuthenticatorTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ void testAddNonResidentCredential() {
189189
Credential.createNonResidentCredential(
190190
credentialId, "localhost", privateKey, /* signCount= */ 0);
191191
authenticator.addCredential(credential);
192+
authenticator.getCredentials();
192193

193194
// Attempt to use the credential to generate an assertion.
194195
Object response = getAssertionFor(Arrays.asList(1, 2, 3, 4));
@@ -215,6 +216,7 @@ void testAddNonResidentCredentialWhenAuthenticatorUsesU2FProtocol() {
215216
Credential.createNonResidentCredential(
216217
credentialId, "localhost", privateKey, /* signCount= */ 0);
217218
authenticator.addCredential(credential);
219+
authenticator.getCredentials();
218220

219221
// Attempt to use the credential to generate an assertion.
220222
Object response = getAssertionFor(Arrays.asList(1, 2, 3, 4));
@@ -231,6 +233,7 @@ void testAddResidentCredential() {
231233
Credential.createResidentCredential(
232234
credentialId, "localhost", privateKey, userHandle, /* signCount= */ 0);
233235
authenticator.addCredential(credential);
236+
authenticator.getCredentials();
234237

235238
// Attempt to use the credential to generate an assertion. Notice we use an
236239
// empty allowCredentials array.
@@ -265,6 +268,7 @@ void testAddResidentCredentialNotSupportedWhenAuthenticatorUsesU2FProtocol() {
265268
Credential.createResidentCredential(
266269
credentialId, "localhost", privateKey, userHandle, /* signCount= */ 0);
267270
authenticator.addCredential(credential);
271+
authenticator.getCredentials();
268272
});
269273
}
270274

0 commit comments

Comments
 (0)