Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Rogue / #25

Merged

Conversation

yashasip
Copy link
Contributor

@yashasip yashasip commented Apr 13, 2024

Rogue / Appears at the End of the label

There is a / that is appended at the end of the label. As a result, in the authenticator apps, label ends with /.

For the URI generated using this below:

import dev.turingcomplete.kotlinonetimepassword.OtpAuthUriBuilder
import org.apache.commons.codec.binary.Base32

fun main() {
    val authURI = OtpAuthUriBuilder.forTotp(Base32().encode("secret".toByteArray()))
        .label("John", "Company")
        .issuer("Company")
        .digits(8)
        .buildToString()

    println(authURI)
}

Generated URI: otpauth://totp/Company:John/?issuer Company&digits=8&secret=ONSWG4TFOQ

After scanning the QR code generated using the above URI the key entry as seen on the authenticator app (Google Authenticator):
Screenshot from 2024-04-13 23-07-11

This PR fixes this bug.

@marcelkliemannel marcelkliemannel changed the base branch from master to develop April 15, 2024 17:40
@marcelkliemannel marcelkliemannel self-assigned this Apr 15, 2024
@marcelkliemannel marcelkliemannel merged commit eb89a1a into marcelkliemannel:develop Apr 15, 2024
1 check passed
@marcelkliemannel
Copy link
Owner

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants