Giter VIP home page Giter VIP logo

magnolia-module-keycloak-security's Introduction

GitHub Tag Maven Central License

magnolia-module-keycloak-security

Keycloak SSO/IAM integration for Magnolia 5.5, 5.6

This module delegates authentication - in addition to Magnolias builtin authentication mechanisms - to Keycloak.

This module delegates authentication - in addition to Magnolias builtin authentication mechanisms - to Keycloak.

Contributions welcome!

Installation

  • create a client in Keycloak with Direct Access Grants enabled
  • export the configuration in Keycloak OIDC JSON format from the Installation tab
  • save the configuration file into your projects classpath, i.e. src/main/resources/keycloak.json
  • configure src/main/webapp/WEB-INF/config/jaas.config to include the KeycloakAuthenticationModule:
magnolia {
  info.magnolia.jaas.sp.jcr.JCRAuthenticationModule optional realm=system;

  org.sevensource.magnolia.keycloak.security.KeycloakLoginModuleAdapter requisite realm=external skip_on_previous_success=true;
  info.magnolia.jaas.sp.jcr.JCRAuthorizationModule required;
};

Configuration

All additional configuration is stored in Magnolias JCR.

  • login into magnolia using the superuser account
  • go into Configurations App and navigate to /modules/keycloak-security/config and add your keycloakConfigFile, i.e. classpath:keycloak.json
  • the module features a RoleMapper, which maps Keycloak roles to Magnolia roles. It is configured in /modules/keycloak-security/config/roleMapper.
  • the module installs a UserManager into /server/security/userManagers/external which can be used as an extension point for customisation

magnolia-module-keycloak-security's People

Contributors

pgaschuetz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

magnolia-module-keycloak-security's Issues

DefaultRoleMapper invalid handling of mapUnmappedRolesAsIs

I think

@Override
public String mapRole(String role) {
	final String target = mappings.get(role);
	if(! StringUtils.isEmpty(target)) {
		return target;
	} else {
		return mapUnmappedRolesAsIs ? target : null;
	}
}

should actually be

@Override
public String mapRole(String role) {
	final String target = mappings.get(role);
	if(! StringUtils.isEmpty(target)) {
		return target;
	} else {
		return mapUnmappedRolesAsIs ? role : null;
	}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.