domino-keycloak
JsInterop wrapper for keycloak
Maven dependency
<dependency>
<groupId>org.dominokit</groupId>
<artifactId>domino-keycloak</artifactId>
<version>1.0.0</version>
</dependency>
GWT inherits
<inherits name="org.dominokit.keycloak"/>
Usage
-
Make sure the
keycloak.js
adapter is loaded in your html page. -
Create a new keycloak instance
KEYCLOAK = Keycloak.create([url to load the keycloak config json file or a json string]);
- Use the new created instance
keycloakInstance().onReady = (authenticated -> {
if (authenticated) {
// Authenticated user
} else {
KEYCLOAK.login(LoginOptions.create());
}
});