Class FileBasedResourcePrincipalFederationClient

    • Constructor Detail

      • FileBasedResourcePrincipalFederationClient

        public FileBasedResourcePrincipalFederationClient​(SessionKeySupplier sessionKeySupplier,
                                                          String resourcePrincipalSessionTokenPath)
        Constructor of FileBasedResourcePrincipalFederationClient.
        Parameters:
        sessionKeySupplier - the session key supplier.
        resourcePrincipalSessionTokenPath - the path to load the RPST from
    • Method Detail

      • getSecurityToken

        public String getSecurityToken()
        Description copied from interface: FederationClient
        Gets a security token from the federation endpoint.

        May use a cached token if it judged to still be valid.

        Specified by:
        getSecurityToken in interface FederationClient
        Returns:
        A security token that can be used to authenticate requests.
      • refreshAndGetSecurityToken

        public String refreshAndGetSecurityToken()
        Description copied from interface: FederationClient
        Gets a security token from the federation endpoint.

        This will always retreive a new token from the federation endpoint and does not use a cached token.

        Specified by:
        refreshAndGetSecurityToken in interface FederationClient
        Returns:
        A security token that can be used to authenticate requests.
      • getSecurityTokenFromFile

        protected SecurityTokenAdapter getSecurityTokenFromFile()
        Gets a security token from file
        Returns:
        the security token, which is basically a JWT token string
      • refreshAndGetSecurityTokenIfExpiringWithin

        public String refreshAndGetSecurityTokenIfExpiringWithin​(Duration time,
                                                                 boolean refreshKeys)
        Description copied from interface: ProvidesConfigurableRefresh
        Gets a security token from the federation endpoint if the security token expires within the provided duration and allows to enable/disable refresh of keys.

        This will always retrieve a new token from the federation endpoint and does not use a cached token.

        Specified by:
        refreshAndGetSecurityTokenIfExpiringWithin in interface ProvidesConfigurableRefresh
        Parameters:
        time - the duration to check
        refreshKeys - boolean value to enable/disable refresh of keys
        Returns:
        A security token that can be used to authenticate requests.
      • refreshAndGetSecurityTokenIfExpiringWithin

        public String refreshAndGetSecurityTokenIfExpiringWithin​(Duration time)
        Description copied from interface: ProvidesConfigurableRefresh
        Gets a security token from the federation endpoint if the security token expires within the provided duration.

        This will always retrieve a new token from the federation endpoint and does not use a cached token.

        Specified by:
        refreshAndGetSecurityTokenIfExpiringWithin in interface ProvidesConfigurableRefresh
        Parameters:
        time - the duration to check
        Returns:
        A security token that can be used to authenticate requests.