Class AuthIdHelper


  • @Singleton
    public class AuthIdHelper
    extends Object
    Helper class to create and verify authentication JWTs.
    • Constructor Detail

      • AuthIdHelper

        @Inject
        public AuthIdHelper​(CoreServicesWrapper coreServicesWrapper,
                            org.forgerock.json.jose.builders.JwtBuilderFactory jwtBuilderFactory,
                            org.forgerock.json.jose.jws.SigningManager signingManager)
        Constructs an instance of the AuthIdHelper.
        Parameters:
        coreServicesWrapper - An instance of the CoreServicesWrapper.
        jwtBuilderFactory - An instance of the JwtBuilderFactory.
        signingManager - An instance of the SigningManager.
    • Method Detail

      • reconstructAuthId

        public org.forgerock.json.jose.jws.SignedJwt reconstructAuthId​(String authId)
                                                                throws RestAuthException
        Reconstructs the Auth Id from a String to a JWT.
        Parameters:
        authId - The Auth Id jwt string
        Returns:
        The JWT object.
        Throws:
        RestAuthException
      • verifyAuthId

        public void verifyAuthId​(String realmDN,
                                 String authId)
                          throws RestAuthException
        Verifies the signature of the JWT, to ensure the JWT is valid.
        Parameters:
        realmDN - The DN for the realm being authenticated against.
        authId - The authentication id JWT.
        Throws:
        RestAuthException