@@ -33,7 +33,7 @@ def _encode_jwt(additional_token_data, expires_delta, secret, algorithm,
3333
3434def encode_access_token (identity , secret , algorithm , expires_delta , fresh ,
3535 user_claims , csrf , identity_claim_key , user_claims_key ,
36- json_encoder = None , headers = None ):
36+ json_encoder = None , headers = None , issuer = None ):
3737 """
3838 Creates a new encoded (utf-8) access token.
3939
@@ -54,6 +54,7 @@ def encode_access_token(identity, secret, algorithm, expires_delta, fresh,
5454 :param identity_claim_key: Which key should be used to store the identity
5555 :param user_claims_key: Which key should be used to store the user claims
5656 :param headers: valid dict for specifying additional headers in JWT header section
57+ :param issuer: Issuer value configured as JWT_ENCODE_ISSUER
5758 :return: Encoded access token
5859 """
5960
@@ -73,6 +74,8 @@ def encode_access_token(identity, secret, algorithm, expires_delta, fresh,
7374
7475 if csrf :
7576 token_data ['csrf' ] = _create_csrf_token ()
77+ if issuer is not None :
78+ token_data ['iss' ] = issuer
7679 return _encode_jwt (token_data , expires_delta , secret , algorithm ,
7780 json_encoder = json_encoder , headers = headers )
7881
0 commit comments