![]() from_signing_credentials ( svc_creds, audience = audience ) ParametersĬredentials ( ) – The credentials to from_service_account_file ( 'service_account.json' ) audience = ( '' ) jwt_creds = jwt. Will use the existing instance’s signer email as the issuer and The new instance will use the same signer as the existing instance and classmethod from_signing_credentials ( credentials, audience, **kwargs ) ¶Ĭreates a new instance from anĮxisting instance. json fileįilename ( str) – The path to the service account. classmethod from_service_account_file ( filename, **kwargs ) ¶Ĭreates a Credentials instance from a service account. ValueError – If the info is not in the expected format. Kwargs – Additional arguments to pass to the constructor. Info ( Mapping ) – The service account info in Google Defaults to 1 hour.Ĭlassmethod from_service_account_info ( info, **kwargs ) ¶Ĭreates an Credentials instance from a dictionary. Token_lifetime ( int) – The amount of time in seconds for The intended audience for theĪdditional_claims ( Mapping ) – Any additional claims for Signer ( ) – The signer used to sign JWTs.Īudience ( str) – the aud claim. with_claims ( audience = new_audience ) Parameters New_audience = ( '' ) new_credentials = credentials. To create JWT credentials using a Google service account private key One of the helper constructors as shown in the next section. Usually, you’ll construct these credentials with The constructor arguments determine the claims for the JWT that is These credentials require an “audience” claim. class Credentials ( signer, issuer, subject, audience, additional_claims=None, token_lifetime=3600 ) ¶īases:, Ĭredentials that use a JWT as the bearer token. ValueError – if any verification checks failed. The deserialized JSON payload in the JWT. If None then the JWT’s ‘aud’ parameter is not verified. Verify ( bool) – Whether to perform signature and claim validation.Īudience ( str) – The audience claim, ‘aud’, that this JWT shouldĬontain. ![]() The mapping must contain the same key ID that’s specified ![]() It must be a mapping of key IDs to public key certificates in PEMįormat. It must the the public key certificate in PEM format. Mapping decode ( token, certs=None, verify=True, audience=None ) ¶Ĭerts ( Union ] ]) – TheĬertificate used to validate the JWT signature. The header in order to acquire the appropriate certificate to verify This is useful to extract the key id from Specified it will override the signer’s key id. Signer has a key id it will be used as the default. Key_id ( str) – The key id to add to the JWT header. Header ( Mapping ) – Additional JWT header payload. Signer ( ) – The signer used to sign the JWT. decode ( encoded, verify = False ) encode ( signer, payload, header=None, key_id=None ) ¶
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |