1.0.3 • Published 3 years ago

@meveo-org/mv-keycloak v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

mv-keycloak

MvKeycloak is a Meveo component (based on lit-element) that allows meveo page components to be secured by Keycloak.

Features

  • Written in vanilla javascript
  • Simplifies keycloak integration with page components

Quick Start

To use MvKeycloak component:

  1. Clone this repo.
  2. Run keycloak standalone or via docker using the included docker-compose.yml file.
  3. Serve the project from the root directory with some http server (best served with meveo itself)
  4. Download the Keycloak OIDC JSON configuration file as described here https://www.keycloak.org/docs/latest/authorization_services/#obtaining-the-adapter-configuration
  5. Copy the keycloak.json file obtained from step 3 into the project directory.
  6. Import mv-keycloak into the page and wrap the page component with the mv-keycloak tag. e.g.

    <mv-keycloak
      settings-path="./keycloak.json"
      @auth-success="${this.handleLogin}"
      @auth-fail="${this.handleLoginFail}"
      @auth-init-fail="${this.handleLoginFail}"
    >
      <h1>This is a secure page</h1>
      <button @click="${this.handleLogout}">Logout</button>
      <div slot="loading">This message is shown while loading...</div>
      <div slot="authenticating">
        This message is shown while authenticating...
      </div>
      <div slot="failed">This message is shown when authentication fails</div>
    </mv-keycloak>

Acknowledgements

1.0.2

3 years ago

1.0.1

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago