Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val token = keycloak.keycloakForFetchUserToken(
- authentication.principal.toString(),
- authentication.credentials.toString()
- ).tokenManager().accessToken
- fun keycloakForFetchUserToken(username:String, password: String): Keycloak {
- return KeycloakBuilder.builder()
- .serverUrl(KeycloakAttributes.SERVER_URL.value())
- .username(username)
- .password(password)
- .realm(KeycloakAttributes.REALM.value())
- .clientId(KeycloakAttributes.CLIENT_ID.value())
- .clientSecret(KeycloakAttributes.CLIENT_SECRET.value())
- .resteasyClient(ResteasyClientBuilder().connectionPoolSize(20).register(CustomJacksonProvider()).build())
- .build()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement