is_valid_token¶
- igwn_auth_utils.scitokens.is_valid_token(token, audience, scope, issuer=None, timeleft=60, warn=False)¶
Test whether a
tokenis valid according to the given claims.- Parameters:
token (
scitokens.SciToken,str) – The token object, or serialisation, to testtimeleft (
float) – The amount of time remaining (in seconds, from theexpclaim) to require.issuer (
str,listofstr) – The value of theissclaim to enforce. Ifissueris given as a list (or other non-stringy container), the token will be required to match any of the entries.warn (
bool) – IfTrue, emit a warning when a token fails the enforcer test, useful in debugging bad tokens.
- Returns:
valid –
Trueif the inputtokenmatches the required claims, otherwiseFalse.- Return type: