Skip to content

Commit 91ee550

Browse files
committed
Strip padding in ByteArray.fromBase64Url
1 parent 7ce70cc commit 91ee550

File tree

1 file changed

+2
-2
lines changed
  • webauthn-server-core/src/main/java/com/yubico/webauthn/data

1 file changed

+2
-2
lines changed

webauthn-server-core/src/main/java/com/yubico/webauthn/data/ByteArray.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static ByteArray fromBase64(@NonNull final String base64) {
8080
*/
8181
@JsonCreator
8282
public static ByteArray fromBase64Url(@NonNull final String base64) throws Base64UrlException {
83-
return new ByteArray(base64);
83+
return new ByteArray(base64.split("=")[0]);
8484
}
8585

8686
/**
@@ -122,7 +122,7 @@ public String getBase64() {
122122
return BASE64_ENCODER.encodeToString(bytes);
123123
}
124124

125-
/** @return the content bytes encoded as Base64Url data. */
125+
/** @return the content bytes encoded as Base64Url data, without padding. */
126126
public String getBase64Url() {
127127
return base64;
128128
}

0 commit comments

Comments
 (0)