#NEWLINE# def test_client_secret_jwt( self , client ) : #NEWLINE# #INDENT# client . token_endpoint = 'https://example.com/token' #NEWLINE# csj = ClientSecretJWT ( client ) #NEWLINE# cis = AccessTokenRequest ( ) #NEWLINE# http_args = csj . construct ( cis , algorithm = 'HS256' ) #NEWLINE# assert ( cis [ 'client_assertion_type' ] == JWT_BEARER ) #NEWLINE# assert ( 'client_assertion' in cis ) #NEWLINE# cas = cis [ 'client_assertion' ] #NEWLINE# _jwt = JWT ( ) . unpack ( cas ) #NEWLINE# jso = _jwt . payload ( ) #NEWLINE# assert _eq ( jso . keys ( ) , [ 'aud' , 'iss' , 'sub' , 'jti' , 'exp' , 'iat' ] ) #NEWLINE# assert ( _jwt . headers == { #NEWLINE# #INDENT# 'alg' : 'HS256' , #NEWLINE# #UNINDENT# } ) #NEWLINE# _rj = JWS ( ) #NEWLINE# info = _rj . verify_compact ( cas , [ SYMKey ( key = client . client_secret ) ] ) #NEWLINE# assert _eq ( info . keys ( ) , [ 'aud' , 'iss' , 'sub' , 'jti' , 'exp' , 'iat' ] )