Software Alternatives & Reviews

How to Configure Multitenancy in Keycloak with Spring API Gateway Integration

JSON Web Token httpbin(1)
  1. JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.
    Pricing:
    • Open Source
    @GetMapping("/user-info") Public String userInfo() { return getUserInfo(); } @SuppressWarnings("unchecked") Private String getUserInfo() { KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) SecurityContextHolder.getContext() .getAuthentication(); final Principal principal = (Principal) authentication.getPrincipal(); String tokenInfo = null; if (principal instanceof KeycloakPrincipal) { KeycloakPrincipal kPrincipal = (KeycloakPrincipal) principal; KeycloakSecurityContext ksc = kPrincipal.getKeycloakSecurityContext(); IDToken token = ksc.getIdToken(); AccessToken accessToken = kPrincipal.getKeycloakSecurityContext().getToken(); tokenInfo = accessToken.getSubject(); // this value is the one use to call another service as bearer token // Authorization : Bearer kcs.getTokenString() // use this link to read the token https://jwt.io return String.format("Hello %s %s [subject=%s]", accessToken.getGivenName(), accessToken.getFamilyName(), tokenInfo); } return "Hello World"; }.

    #Identity Provider #Identity And Access Management #SSO 276 social mentions

  2. HTTP request and response service
    Pricing:
    • Open Source

    #Developer Tools #Proxy #Testing 52 social mentions

Discuss: How to Configure Multitenancy in Keycloak with Spring API Gateway Integration

Log in or Post with