Hi,
I have Java code running on Wildfly 16 that uses Keycloak admin-cli java library to
interact with Keycloak. Code works fine from command line, it works fine when use thru
REST interface. But it doesn’t work when used from @Scheduled EJB ….
Code is really simple
Keycloak kc = KeycloakBuilder.builder()
.serverUrl(“foo")
.realm(“bar")
.grantType(OAuth2Constants.PASSWORD)
.clientId(“foo")
.username(“bar")
.password(“foo")
.build();
List<UserRepresentation> users =
kc.realm(“realm").users().search(email, 0, 1);
This fails to code
https://github.com/keycloak/keycloak/blob/e6a274ea0e31c6572e795f3372f006c...
<
https://github.com/keycloak/keycloak/blob/e6a274ea0e31c6572e795f3372f006c...
It seems that that token string is empty
kc.getTokenManager() is not null
kc.getTokenManager().getAccessToken() is not null
kc.getTokenManager().getAccessTokenString() IS NULL
Br,
Tero