find_token#

gwpy.io.scitokens.find_token(audience: str, scope: str, **kwargs) SciToken[source]#

Find and load a Scitoken for the given audience and scope.

Parameters:
audiencestr

The required value for the aud claim.

scopestr

The required value for the scope claim. Can be a space-separated list of multiple scopes, _all_ of which must be matched by the token.

kwargs

All other keyword arguments are passed to igwn_auth_utils.find_scitoken.

Returns:
tokenscitokens.SciToken

The token, if found, that matches the required claims.

Raises:
igwn_auth_utils.IgwnAuthError

If no valid token can be found.

See also

igwn_auth_utils.find_scitoken

For details on acceptable keyword arguments, and how tokens are discovered.

gwpy.io.scitoken.get_scitoken

To acquire a new token from the token issuer.