Class KeycloakAccessTokenVerifier


  • public class KeycloakAccessTokenVerifier
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      KeycloakAccessTokenVerifier​(org.activiti.cloud.services.identity.keycloak.KeycloakProperties config)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.security.PublicKey getPublicKey​(org.keycloak.jose.jws.JWSHeader jwsHeader)  
      java.lang.String getRealmCertsUrl()  
      java.lang.String getRealmUrl()  
      protected java.security.PublicKey retrievePublicKeyFromCertsEndpoint​(java.lang.String realmCertsUrl, org.keycloak.jose.jws.JWSHeader jwsHeader)  
      org.keycloak.representations.AccessToken verifyToken​(java.lang.String tokenString)
      Verifies a token against a keycloak instance
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeycloakAccessTokenVerifier

        public KeycloakAccessTokenVerifier​(org.activiti.cloud.services.identity.keycloak.KeycloakProperties config)
    • Method Detail

      • verifyToken

        public org.keycloak.representations.AccessToken verifyToken​(java.lang.String tokenString)
                                                             throws org.keycloak.common.VerificationException
        Verifies a token against a keycloak instance
        Parameters:
        tokenString - the string representation of the jws token
        Returns:
        a validated keycloak AccessToken
        Throws:
        org.keycloak.common.VerificationException - when the token is not valid
      • getPublicKey

        protected java.security.PublicKey getPublicKey​(org.keycloak.jose.jws.JWSHeader jwsHeader)
      • retrievePublicKeyFromCertsEndpoint

        protected java.security.PublicKey retrievePublicKeyFromCertsEndpoint​(java.lang.String realmCertsUrl,
                                                                             org.keycloak.jose.jws.JWSHeader jwsHeader)
      • getRealmUrl

        public java.lang.String getRealmUrl()
      • getRealmCertsUrl

        public java.lang.String getRealmCertsUrl()