Class RegisterParamsValidator


  • @Named
    public class RegisterParamsValidator
    extends java.lang.Object
    Validates the parameters received for the register web service.
    Version:
    July 28, 2021
    Author:
    Javier Rojas Blum
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean checkIfThereIsPasswordGrantType​(java.util.List<io.jans.as.model.common.GrantType> grantTypes)
      Check if exists a Password Grant Type in the list of Grant Types.
      void validateAlgorithms​(io.jans.as.client.RegisterRequest registerRequest)
      Validates all algorithms received for a register client request.
      boolean validateInitiateLoginUri​(java.lang.String initiateLoginUri)  
      void validateLogoutUri​(java.lang.String logoutUri, java.util.List<java.lang.String> redirectUris, io.jans.as.model.error.ErrorResponseFactory errorResponseFactory)  
      void validateLogoutUri​(java.util.List<java.lang.String> logoutUris, java.util.List<java.lang.String> redirectUris, io.jans.as.model.error.ErrorResponseFactory errorResponseFactory)  
      boolean validateParamsClientRead​(java.lang.String clientId, java.lang.String accessToken)
      Validates the parameters for a client read request.
      io.jans.as.model.util.Pair<java.lang.Boolean,​java.lang.String> validateParamsClientRegister​(io.jans.as.model.register.ApplicationType applicationType, io.jans.as.model.common.SubjectType subjectType, java.util.List<io.jans.as.model.common.GrantType> grantTypes, java.util.List<io.jans.as.model.common.ResponseType> responseTypes, java.util.List<java.lang.String> redirectUris)
      Validates the parameters for a register request.
      boolean validateRedirectUris​(java.util.List<io.jans.as.model.common.GrantType> grantTypes, java.util.List<io.jans.as.model.common.ResponseType> responseTypes, io.jans.as.model.register.ApplicationType applicationType, io.jans.as.model.common.SubjectType subjectType, java.util.List<java.lang.String> redirectUris, java.lang.String sectorIdentifierUrl)  
      • Methods inherited from class java.lang.Object

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

      • RegisterParamsValidator

        public RegisterParamsValidator()
    • Method Detail

      • validateParamsClientRegister

        public io.jans.as.model.util.Pair<java.lang.Boolean,​java.lang.String> validateParamsClientRegister​(io.jans.as.model.register.ApplicationType applicationType,
                                                                                                                 io.jans.as.model.common.SubjectType subjectType,
                                                                                                                 java.util.List<io.jans.as.model.common.GrantType> grantTypes,
                                                                                                                 java.util.List<io.jans.as.model.common.ResponseType> responseTypes,
                                                                                                                 java.util.List<java.lang.String> redirectUris)
        Validates the parameters for a register request.
        Parameters:
        applicationType - The Application Type: native or web.
        subjectType - The subject_type requested for responses to this Client.
        grantTypes - Grant Types that the Client is declaring that it will restrict itself to using.
        redirectUris - Space-separated list of redirect URIs.
        Returns:
        Whether the parameters of client register is valid or not.
      • validateAlgorithms

        public void validateAlgorithms​(io.jans.as.client.RegisterRequest registerRequest)
        Validates all algorithms received for a register client request. It throws a WebApplicationException whether a validation doesn't pass.
        Parameters:
        registerRequest - Object containing all parameters received to register a client.
      • validateParamsClientRead

        public boolean validateParamsClientRead​(java.lang.String clientId,
                                                java.lang.String accessToken)
        Validates the parameters for a client read request.
        Parameters:
        clientId - Unique Client identifier.
        accessToken - Access Token obtained out of band to authorize the registrant.
        Returns:
        Whether the parameters of client read is valid or not.
      • validateRedirectUris

        public boolean validateRedirectUris​(java.util.List<io.jans.as.model.common.GrantType> grantTypes,
                                            java.util.List<io.jans.as.model.common.ResponseType> responseTypes,
                                            io.jans.as.model.register.ApplicationType applicationType,
                                            io.jans.as.model.common.SubjectType subjectType,
                                            java.util.List<java.lang.String> redirectUris,
                                            java.lang.String sectorIdentifierUrl)
        Parameters:
        grantTypes - Grant Types that the Client is declaring that it will restrict itself to using.
        applicationType - The Application Type: native or web.
        subjectType - Subject Type requested for responses to this Client.
        redirectUris - Redirection URI values used by the Client.
        sectorIdentifierUrl - A HTTPS scheme URL to be used in calculating Pseudonymous Identifiers by the OP. The URL contains a file with a single JSON array of redirect_uri values.
        Returns:
        Whether the Redirect URI parameters are valid or not.
      • validateInitiateLoginUri

        public boolean validateInitiateLoginUri​(java.lang.String initiateLoginUri)
      • validateLogoutUri

        public void validateLogoutUri​(java.util.List<java.lang.String> logoutUris,
                                      java.util.List<java.lang.String> redirectUris,
                                      io.jans.as.model.error.ErrorResponseFactory errorResponseFactory)
      • validateLogoutUri

        public void validateLogoutUri​(java.lang.String logoutUri,
                                      java.util.List<java.lang.String> redirectUris,
                                      io.jans.as.model.error.ErrorResponseFactory errorResponseFactory)
      • checkIfThereIsPasswordGrantType

        public boolean checkIfThereIsPasswordGrantType​(java.util.List<io.jans.as.model.common.GrantType> grantTypes)
        Check if exists a Password Grant Type in the list of Grant Types.
        Parameters:
        grantTypes - List of Grant Types.
        Returns:
        True if Password Grant Type exists in the list, otherwise false