Skip to content

Quickly integrate SSO module to Magnolia CMS using Keycloak

License

Notifications You must be signed in to change notification settings

quangthe/magnolia-sso-keycloak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magnolia SSO with Keycloak

Installation steps

Keycloak

Version: 26.0.5

Spin up Keycloak server with pre-configured realm/client/users for Magnolia SSO

docker-compose up

Magnolia

Tested with:

Edit magnolia-sso config.yaml file: <light-modules-dir>/magnolia-sso/config.yaml

path: /.magnolia/admincentral
callbackUrl: http://localhost:8080/.auth
postLogoutRedirectUri: http://localhost:8080/.magnolia/admincentral
authorizationGenerators:
  - name: groupsAuthorization
    groups:
      mappings:
        - name: /superuser
          targetRoles:
            - superuser
clients:
  oidc.id: mgnl-client
  oidc.secret: 763c0d26-a075-4242-b386-946a3ddccbff
  oidc.clientAuthenticationMethod: client_secret_basic
  oidc.scope: openid profile email
  oidc.discoveryUri:  http://localhost:8180/realms/magnolia-sso/.well-known/openid-configuration
  oidc.preferredJwsAlgorithm: RS256
  oidc.authorizationGenerators: groupsAuthorization

userFieldMappings:
  name: preferred_username
  removeEmailDomainFromUserName: true
  removeSpecialCharactersFromUserName: false
  fullName: name
  email: email
  language: locale

jaas.config file: WEB-INF/config/jaas.config

sso-authentication {
  info.magnolia.sso.jaas.SsoAuthenticationModule requisite;
  info.magnolia.jaas.sp.jcr.JCRAuthorizationModule required;
};

Then start Magnolia instance (ensure to configure magnolia.resources.dir point to <light-modules-dir>), navigating to admin central should redirect you to Keycloak login page.

Clean up

Stop keycloak docker-compose down -v

About

Quickly integrate SSO module to Magnolia CMS using Keycloak

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published