Advertisement
Guest User

Untitled

a guest
Mar 6th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. val token = keycloak.keycloakForFetchUserToken(
  2. authentication.principal.toString(),
  3. authentication.credentials.toString()
  4. ).tokenManager().accessToken
  5.  
  6.  
  7. fun keycloakForFetchUserToken(username:String, password: String): Keycloak {
  8. return KeycloakBuilder.builder()
  9. .serverUrl(KeycloakAttributes.SERVER_URL.value())
  10. .username(username)
  11. .password(password)
  12. .realm(KeycloakAttributes.REALM.value())
  13. .clientId(KeycloakAttributes.CLIENT_ID.value())
  14. .clientSecret(KeycloakAttributes.CLIENT_SECRET.value())
  15. .resteasyClient(ResteasyClientBuilder().connectionPoolSize(20).register(CustomJacksonProvider()).build())
  16. .build()
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement