clowder-framework / clowder

A data management system that allows users to share, annotate, organize and analyze large collections of datasets. It provides support for extensible metadata annotation using JSON-LD and a distribute analytics event bus for automatic curation of uploaded data.
https://clowderframework.org/
University of Illinois/NCSA Open Source License
33 stars 17 forks source link

419 authenticator against keycloak #420

Closed longshuicy closed 10 months ago

longshuicy commented 10 months ago

Description

Add provider for keycloak authentication.

Login

How to test:

1. Have a running keycloak instance (can reuse the clowder2 keycloak container)

2. Unzip, import the realm or create your own.

realm-export.json.zip

3. If you choose to create your own realm, make sure you register the redirect URL as {host}/authenticate/keycloak

image

4. Get the client secret

Pasted Graphic 2

5. overwrite config by add below to the custom/custom.conf

ehcacheplugin = enabled

securesocial.keycloak={
    authorizationUrl="http://localhost:8080/keycloak/realms/clowder1/protocol/openid-connect/auth"
    accessTokenUrl="http://localhost:8080/keycloak/realms/clowder1/protocol/openid-connect/token"
    userinfoUrl="http://localhost:8080/keycloak/realms/clowder1/protocol/openid-connect/userinfo"
    clientId="clowder1-backend"
    clientSecret= client scecret copied from step 3
    scope="profile email roles"
}

6. create custom/play.plugins with

10005:services.KeycloakProvider

7. test http://localhost:9000/login

Review Time Estimate

Types of changes

Checklist: