Class OAuth2AuthorizationProvider

    • Constructor Detail

      • OAuth2AuthorizationProvider

        public OAuth2AuthorizationProvider()
    • Method Detail

      • init

        public void init​(BaseOBObject configuration)
        Initializes the required information based on the provided configuration
        Specified by:
        init in interface HttpAuthorizationProvider
        configuration - A BaseOBObject containing the following properties:
        - id: the ID of the external system. Used for logging purposes.
        - oauth2AuthServerUrl: the URL of the authorization server that serves the tokens
        - oauth2ClientIdentifier: the ID of the OAuth2 client
        - oauth2ClientSecret: the OAuth2 client secret encrypted and decryptable using FormatUtilities.encryptDecrypt(String, boolean)
        ExternalSystemConfigurationError - if there is an error decrypting the provided client secret
      • handleRequestRetry

        public boolean handleRequestRetry​(int responseStatusCode)
        Description copied from interface: HttpAuthorizationProvider
        This method allows to execute additional actions required by the authorization method before retrying a request for which an error response is received. It also allows to skip the retry if needed by using the returned value: if true is returned then the retry is done and if false is returned then no retry is attempted.
        Specified by:
        handleRequestRetry in interface HttpAuthorizationProvider
        responseStatusCode - The status code of the external system response
        true if it is necessary to retry the connection with the External System or false to skip the retry