spring-keycloak-multitenant | sample project to illustrate | Identity Management library

 by   ineat Java Version: Current License: No License

kandi X-RAY | spring-keycloak-multitenant Summary

kandi X-RAY | spring-keycloak-multitenant Summary

spring-keycloak-multitenant is a Java library typically used in Security, Identity Management, Spring Boot, Spring, Gradle applications. spring-keycloak-multitenant has no bugs, it has no vulnerabilities, it has build file available and it has low support. You can download it from GitHub.

This is a sandbox / sample project to illustrate the multi-tenant with Keycloak and Spring Boot Multi tenant with Keycloak.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              spring-keycloak-multitenant has a low active ecosystem.
              It has 21 star(s) with 12 fork(s). There are 7 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              spring-keycloak-multitenant has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of spring-keycloak-multitenant is current.

            kandi-Quality Quality

              spring-keycloak-multitenant has 0 bugs and 0 code smells.

            kandi-Security Security

              spring-keycloak-multitenant has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              spring-keycloak-multitenant code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              spring-keycloak-multitenant does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              spring-keycloak-multitenant releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              spring-keycloak-multitenant saves you 130 person hours of effort in developing the same functionality from scratch.
              It has 326 lines of code, 17 functions and 6 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed spring-keycloak-multitenant and discovered the below as its top functions. This is intended to give you an instant insight into spring-keycloak-multitenant implemented functionality, and help decide if they suit your requirements.
            • Override keycloakSpringBootProperties
            • Sets the adapter config
            • Sets the CORS headers
            • Finds a keycloak deployment for the given request
            • Main entry point
            Get all kandi verified functions for this library.

            spring-keycloak-multitenant Key Features

            No Key Features are available at this moment for spring-keycloak-multitenant.

            spring-keycloak-multitenant Examples and Code Snippets

            No Code Snippets are available at this moment for spring-keycloak-multitenant.

            Community Discussions

            Trending Discussions on spring-keycloak-multitenant

            QUESTION

            Keycloak Spring Multitenant Null Pointer Exception
            Asked 2019-Mar-22 at 00:05

            Source Code from : https://github.com/ineat/spring-keycloak-multitenant

            Started Keycloak and added realms as instructed in the readme file.

            Updated the Keycloak Json codes at respective places.

            Started Spring Project.

            Got the Following Exceptions upon calling "http://localhost:8081/multitenant" :

            2019-03-20 18:34:28.195 ERROR 25640 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost] : Exception Processing /multitenant

            2019-03-20 18:34:28.248 ERROR 25640 --- [nio-8081-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] threw exception

            2019-03-20 18:34:28.249 ERROR 25640 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost] : Exception Processing ErrorPage[errorCode=0, location=/error]

            2019-03-20 18:34:28.251 ERROR 25640 --- [nio-8081-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] threw exception

            2019-03-20 18:34:28.252 ERROR 25640 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost] : Exception Processing ErrorPage[errorCode=0, location=/error]

            2019-03-20 18:34:28.506 ERROR 25640 --- [nio-8081-exec-2] o.a.c.c.C.[Tomcat].[localhost] : Exception Processing /favicon.ico

            2019-03-20 18:34:28.511 ERROR 25640 --- [nio-8081-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] threw exception

            2019-03-20 18:34:28.512 ERROR 25640 --- [nio-8081-exec-2] o.a.c.c.C.[Tomcat].[localhost] : Exception Processing ErrorPage[errorCode=0, location=/error]

            2019-03-20 18:34:28.514 ERROR 25640 --- [nio-8081-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] threw exception

            2019-03-20 18:34:28.515 ERROR 25640 --- [nio-8081-exec-2] o.a.c.c.C.[Tomcat].[localhost] : Exception Processing ErrorPage[errorCode=0, location=/error]

            java.lang.NullPointerException: null at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) ~[na:1.8.0_191] at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:964) ~[na:1.8.0_191] at com.ineat.spring.keycloak.multitenant.HeaderBasedConfigResolver.resolve(HeaderBasedConfigResolver.java:21) ~[classes/:na] at org.keycloak.adapters.AdapterDeploymentContext.resolveDeployment(AdapterDeploymentContext.java:88) ~[keycloak-adapter-core-4.4.0.Final.jar:4.4.0.Final] at org.keycloak.adapters.PreAuthActionsHandler.preflightCors(PreAuthActionsHandler.java:107) ~[keycloak-adapter-core-4.4.0.Final.jar:4.4.0.Final] at org.keycloak.adapters.PreAuthActionsHandler.handleRequest(PreAuthActionsHandler.java:79) ~[keycloak-adapter-core-4.4.0.Final.jar:4.4.0.Final] at org.keycloak.adapters.springsecurity.filter.KeycloakPreAuthActionsFilter.doFilter(KeycloakPreAuthActionsFilter.java:81) ~[keycloak-spring-security-adapter-4.4.0.Final.jar:4.4.0.Final] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) ~[spring-web-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) ~[spring-web-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) ~[spring-security-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) ~[spring-web-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) ~[spring-security-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) ~[spring-web-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) ~[spring-web-5.0.10.RELEASE.jar:5.0.10.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:472) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:395) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:316) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:395) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:254) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:349) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:175) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.34.jar:8.5.34] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.34.jar:8.5.34] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]

            Please advice if there's any more configurations to be made/any errors i should fix.

            Thanks in advance.

            ...

            ANSWER

            Answered 2019-Mar-22 at 00:05

            The spring-boot application you mentioned resolves and loads keycloak configuration for multi tenant based on header field i.e "realm: ORGA1".

            but not sure why you are calling http://localhost:8081/multitenant

            You are supposed to get token for the required tenant and then called the API by passing the right tenant in header of the request

            Source https://stackoverflow.com/questions/55261671

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install spring-keycloak-multitenant

            You can download it from GitHub.
            You can use spring-keycloak-multitenant like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spring-keycloak-multitenant component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/ineat/spring-keycloak-multitenant.git

          • CLI

            gh repo clone ineat/spring-keycloak-multitenant

          • sshUrl

            git@github.com:ineat/spring-keycloak-multitenant.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Identity Management Libraries

            vault

            by hashicorp

            k9s

            by derailed

            keepassxc

            by keepassxreboot

            keycloak

            by keycloak

            uuid

            by uuidjs

            Try Top Libraries by ineat

            keyblock

            by ineatJava

            styleguide

            by ineatHTML