ark::catalog::AuthenticationClient

Defined in header “ark/catalog/authentication_client.hh”.


This client is used to authenticate to the catalog, retrieving access tokens necessary to use the API. It is generally preferred to use this client over the AWS-based clients, as this communicates through the Catalog.

Methods

  • AuthenticationClient(core::Url catalog_url)
    Constructor. Initializes a client against the given Catalog URL.

  • std::string access_token(AccessTokenRetrievalMethod retrieval_method)
    Returns the access token that you can use to talk to services using the Catalog. Returns an empty string if the access token is invalid.

    If a local refresh token is available, and the access token is not valid, this will try to refresh before giving up.

  • std::string refresh_token()
    Returns the refresh token that you can use to grab new access tokens using the catalog. Returns an empty string if the refresh token is invalid or not set.

  • bool revoke_token()
    Revoke token if exists. This allows to delete a previous session. Returns true if previous token exists and revoked otherwise false.

  • std::string username()
    Returns the username that you last authenticated successfully with.

  • AuthenticationResult authenticate(const std::string & username, const std::string & password)
    Authenticates with the given username/password combination. If MFA is required, the session is returned. Otherwise the valid access token is populated.

  • std::string complete_mfa(const std::string & username, const std::string & mfa_code, const std::string & session_name)
    Respond to an MFA challenge to complete the authentication request. Returns the valid access token.