Skip to content

Commit

Permalink
fix: ensure uri has no colon #265
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomer2001 committed Nov 13, 2023
1 parent ba5818d commit d478f10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public String generateSecretKeyUri(byte[] secretKey, String displayName) {
String secretKeyBase32 = BaseEncoding.base32().omitPadding().encode(secretKey);
OTPKey otpKey = new OTPKey(secretKeyBase32, OTPType.HOTP);

OTPAuthURIBuilder uribe = OTPAuthURIBuilder.fromKey(otpKey).label(displayName);
OTPAuthURIBuilder uribe = OTPAuthURIBuilder.fromKey(otpKey).label(displayName.replace(':', ' '));
uribe = uribe.issuer(issuer).digits(conf.getDigits());

logger.trace("Generating secret key URI");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public String generateSecretKeyUri(byte[] secretKey, String displayName) {
String secretKeyBase32 = BaseEncoding.base32().omitPadding().encode(secretKey);
OTPKey otpKey = new OTPKey(secretKeyBase32, OTPType.TOTP);

OTPAuthURIBuilder uribe = OTPAuthURIBuilder.fromKey(otpKey).label(displayName);
OTPAuthURIBuilder uribe = OTPAuthURIBuilder.fromKey(otpKey).label(displayName.replace(':', ' '));
uribe = uribe.issuer(issuer).digits(conf.getDigits());
uribe = uribe.timeStep(TimeUnit.SECONDS.toMillis(conf.getTimeStep()));

Expand Down

0 comments on commit d478f10

Please sign in to comment.