Package com.docusign.esign.client.auth
Class JWTUtils
- java.lang.Object
-
- com.docusign.esign.client.auth.JWTUtils
-
public class JWTUtils extends java.lang.ObjectJWTUtils class.
-
-
Constructor Summary
Constructors Constructor Description JWTUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgenerateJWTAssertion(java.lang.String publicKeyFilename, java.lang.String privateKeyFilename, java.lang.String oAuthBasePath, java.lang.String clientId, java.lang.String userId, long expiresIn)Helper method to create a JWT token for the JWT flow.static java.lang.StringgenerateJWTAssertion(java.lang.String publicKeyFilename, java.lang.String privateKeyFilename, java.lang.String oAuthBasePath, java.lang.String clientId, java.lang.String userId, long expiresIn, java.lang.String scopes)Helper method to create a JWT token for the JWT flow.static java.lang.StringgenerateJWTAssertionFromByteArray(byte[] rsaPrivateKey, java.lang.String oAuthBasePath, java.lang.String clientId, java.lang.String userId, long expiresIn, java.lang.String scopes)Helper method to create a JWT token for the JWT flow.
-
-
-
Method Detail
-
generateJWTAssertionFromByteArray
public static java.lang.String generateJWTAssertionFromByteArray(byte[] rsaPrivateKey, java.lang.String oAuthBasePath, java.lang.String clientId, java.lang.String userId, long expiresIn, java.lang.String scopes) throws java.lang.IllegalArgumentException, com.auth0.jwt.exceptions.JWTCreationException, java.io.IOExceptionHelper method to create a JWT token for the JWT flow.- Parameters:
rsaPrivateKey- the byte contents of the RSA private keyoAuthBasePath- DocuSign OAuth base path (account-d.docusign.com for the developer sandbox and account.docusign.com for the production platform)clientId- DocuSign OAuth Client Id (AKA Integrator Key)userId- DocuSign user Id to be impersonated (This is a UUID)expiresIn- number of seconds remaining before the JWT assertion is considered as invalidscopes- space-separated string that represents the list of scopes to grant to the OAuth token.- Returns:
- a fresh JWT token
- Throws:
java.lang.IllegalArgumentException- if one of the arguments is invalidcom.auth0.jwt.exceptions.JWTCreationException- if not able to create a JWT token from the input parametersjava.io.IOException- if there is an issue with either the public or private file
-
generateJWTAssertion
public static java.lang.String generateJWTAssertion(java.lang.String publicKeyFilename, java.lang.String privateKeyFilename, java.lang.String oAuthBasePath, java.lang.String clientId, java.lang.String userId, long expiresIn) throws com.auth0.jwt.exceptions.JWTCreationException, java.io.IOExceptionHelper method to create a JWT token for the JWT flow.- Parameters:
publicKeyFilename- the filename of the RSA public keyprivateKeyFilename- the filename of the RSA private keyoAuthBasePath- DocuSign OAuth base path (account-d.docusign.com for the developer sandbox and account.docusign.com for the production platform)clientId- DocuSign OAuth Client Id (AKA Integrator Key)userId- DocuSign user Id to be impersonated (This is a UUID)expiresIn- number of seconds remaining before the JWT assertion is considered as invalid- Returns:
- a fresh JWT token
- Throws:
com.auth0.jwt.exceptions.JWTCreationException- if not able to create a JWT token from the input parametersjava.io.IOException- if there is an issue with either the public or private file
-
generateJWTAssertion
public static java.lang.String generateJWTAssertion(java.lang.String publicKeyFilename, java.lang.String privateKeyFilename, java.lang.String oAuthBasePath, java.lang.String clientId, java.lang.String userId, long expiresIn, java.lang.String scopes) throws com.auth0.jwt.exceptions.JWTCreationException, java.io.IOExceptionHelper method to create a JWT token for the JWT flow.- Parameters:
publicKeyFilename- the filename of the RSA public keyprivateKeyFilename- the filename of the RSA private keyoAuthBasePath- DocuSign OAuth base path (account-d.docusign.com for the developer sandbox and account.docusign.com for the production platform)clientId- DocuSign OAuth Client Id (AKA Integrator Key)userId- DocuSign user Id to be impersonated (This is a UUID)expiresIn- number of seconds remaining before the JWT assertion is considered as invalidscopes- space-separated string that represents the list of scopes to grant to the OAuth token.- Returns:
- a fresh JWT token
- Throws:
com.auth0.jwt.exceptions.JWTCreationException- if not able to create a JWT token from the input parametersjava.io.IOException- if there is an issue with either the public or private file
-
-