Class SsaRestWebServiceValidator


  • @Named
    public class SsaRestWebServiceValidator
    extends Object
    Provides methods to validate different params about SSA.
    • Constructor Detail

      • SsaRestWebServiceValidator

        public SsaRestWebServiceValidator()
    • Method Detail

      • getClientFromSession

        public io.jans.as.common.model.registration.Client getClientFromSession()
                                                                         throws jakarta.ws.rs.WebApplicationException
        Get client from session
        Returns:
        Client if obtained.
        Throws:
        jakarta.ws.rs.WebApplicationException - with status 401 and key INVALID_CLIENT if the client cannot be obtained.
      • checkScopesPolicy

        public void checkScopesPolicy​(io.jans.as.common.model.registration.Client client,
                                      String scope)
                               throws jakarta.ws.rs.WebApplicationException
        Check if the client has the given scope.
        Parameters:
        client - Client to check scope
        scope - Scope to validate
        Throws:
        jakarta.ws.rs.WebApplicationException - with status 401 and key UNAUTHORIZED_CLIENT if you don't have the scope.
      • checkScopesPolicy

        public void checkScopesPolicy​(io.jans.as.common.model.registration.Client client,
                                      List<String> scopeList)
                               throws jakarta.ws.rs.WebApplicationException
        Check if the client has at least one scope from the list of scopes.
        Parameters:
        client - Client to check scope
        scopeList - List of scope to validated
        Throws:
        jakarta.ws.rs.WebApplicationException - with status 401 and key UNAUTHORIZED_CLIENT if you don't have the scope.
      • getValidSsaByJti

        public io.jans.as.common.model.ssa.Ssa getValidSsaByJti​(String jti)
        Find SSA based on "jti" and validated

        This method returns WebApplicationException with status 422 if the SSA does not exist or if it is in state (expired, used or revoked). Otherwise it will return the valid SSA

        Parameters:
        jti - Unique identifier
        Returns:
        Ssa valid