How to use the jwcrypto.jws.InvalidJWSObject function in jwcrypto

To help you get started, we’ve selected a few jwcrypto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ONSdigital / eq-survey-runner / app / cryptography / token_helper.py View on Github external
check_claims = {
            "jti": None,
            "exp": None,
            "iat": None,
        }

        signed_token = jwt.JWT(algs=['RS256'], check_claims=check_claims)

        if leeway:
            signed_token.leeway = leeway

        signed_token.deserialize(jwt_token, key=public_jwk)

        return json.loads(signed_token.claims)
    except (InvalidJWSObject,
            InvalidJWSSignature,
            JWTInvalidClaimFormat,
            JWTMissingClaim,
            JWTExpired,
            ValueError) as e:
        raise InvalidTokenException(repr(e))