You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
config := oauth2.Config{
ClientID: enums.Env.KeycloakClientId,
ClientSecret: enums.Env.KeycloakClientSecret,
RedirectURL: enums.Env.KeycloakRedirect,
Endpoint: oauth2.Endpoint{
TokenURL: fmt.Sprintf("%srealms/%s/protocol/openid-connect/token", enums.Env.KeycloakEndpoint, enums.Env.KeycloakRealm),
},
}
// get a valid token from keycloak
ctx := context.Background()
token, err := config.PasswordCredentialsToken(ctx, enums.Env.KeycloakAdmin, enums.Env.KeycloakPassword)
if err != nil {
panic(err)
}
// create a new http client that uses the token on every request
client := config.Client(ctx, token)
// create a new keycloak instance and provide the http client
clientKeycloak, err := keycloak.NewKeycloak(client, enums.Env.KeycloakEndpoint)
clientKeycloak can't call api after refresh_token expired.
The text was updated successfully, but these errors were encountered:
clientKeycloak can't call api after refresh_token expired.
The text was updated successfully, but these errors were encountered: