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

Get PasswordCredentialsToken with TOTP #2

Open
theexiile1305 opened this issue Aug 9, 2021 · 0 comments
Open

Get PasswordCredentialsToken with TOTP #2

theexiile1305 opened this issue Aug 9, 2021 · 0 comments

Comments

@theexiile1305
Copy link

theexiile1305 commented Aug 9, 2021

First of all this is a very great project.

In order to get a valid token you have to pass in username and admin like the following code snippet

// get a valid token from keycloak
    ctx := context.Background()
    token, err := config.PasswordCredentialsToken(ctx, "admin", "admin")
    if err != nil {
        panic(err)
    }

Unfortunately, I can't pass a required OTP-Token, so that my two factor authentication works. Can I adjust the PasswordCredentialsToken or add a second method, that I am able to pass the OTP-Token? The following code snippet describes my idea in detail

// get a valid token from keycloak
    ctx := context.Background()
    token, err := config.PasswordCredentialsToken(ctx, "admin", "admin", "123456")
    if err != nil {
        panic(err)
    }

The result would be another line totp=<one time token> within the application/x-www-form-urlencoded body

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

No branches or pull requests

1 participant