Skip to content

A simple library to provide keycloak support to GWT

License

Notifications You must be signed in to change notification settings

assadriaz/gwt-keycloak

 
 

Repository files navigation

gwt-keycloak

Build Status

A simple library to provide keycloak support to GWT.

Quick Start

The simplest way to use the library is to add the following dependency into the build system. i.e.

<dependency>
   <groupId>org.realityforge.gwt.keycloak</groupId>
   <artifactId>gwt-keycloak</artifactId>
   <version>0.1</version>
   <scope>provided</scope>
</dependency>

Then you add the following snippet into the .gwt.xml file.

<module rename-to='myapp'>
  ...

  <!-- Enable the websocket library -->
  <inherits name="org.realityforge.gwt.keycloak.Keycloak"/>
</module>

Then you can interact with the WebSocket from within the browser.

final Keycloak keycloak = new Keycloak( "MyApp", "http://127.0.0.1:8080/myapp/keycloak.json" );

keycloak.setListener( new KeycloakListenerAdapter()
{
  @Override
  public void onReady( @Nonnull final Keycloak keycloak, final boolean authenticated )
  {
    if( authenticated )
    {
      //Start app here
    }
    else
    {
      keycloak.login();
    }
  }
} );

keycloak.init();

This should be sufficient to put together a simple Keycloak application.

Appendix

About

A simple library to provide keycloak support to GWT

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 89.4%
  • Ruby 10.6%