Package com.docusign.admin.client.auth
Class JWTUtils
- java.lang.Object
-
- com.docusign.admin.client.auth.JWTUtils
-
public class JWTUtils extends Object
JWTUtils class.
-
-
Constructor Summary
Constructors Constructor Description JWTUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgenerateJWTAssertion(String publicKeyFilename, String privateKeyFilename, String oAuthBasePath, String clientId, String userId, long expiresIn)Helper method to create a JWT token for the JWT flow.static StringgenerateJWTAssertion(String publicKeyFilename, String privateKeyFilename, String oAuthBasePath, String clientId, String userId, long expiresIn, String scopes)Helper method to create a JWT token for the JWT flow.static StringgenerateJWTAssertionFromByteArray(byte[] rsaPrivateKey, String oAuthBasePath, String clientId, String userId, long expiresIn, String scopes)Helper method to create a JWT token for the JWT flow.
-
-
-
Method Detail
-
generateJWTAssertionFromByteArray
public static String generateJWTAssertionFromByteArray(byte[] rsaPrivateKey, String oAuthBasePath, String clientId, String userId, long expiresIn, String scopes) throws IllegalArgumentException, com.auth0.jwt.exceptions.JWTCreationException, IOException
Helper 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:
IllegalArgumentException- if one of the arguments is invalidcom.auth0.jwt.exceptions.JWTCreationException- if not able to create a JWT token from the input parametersIOException- if there is an issue with either the public or private file
-
generateJWTAssertion
public static String generateJWTAssertion(String publicKeyFilename, String privateKeyFilename, String oAuthBasePath, String clientId, String userId, long expiresIn) throws com.auth0.jwt.exceptions.JWTCreationException, IOException
Helper 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 parametersIOException- if there is an issue with either the public or private file
-
generateJWTAssertion
public static String generateJWTAssertion(String publicKeyFilename, String privateKeyFilename, String oAuthBasePath, String clientId, String userId, long expiresIn, String scopes) throws com.auth0.jwt.exceptions.JWTCreationException, IOException
Helper 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 parametersIOException- if there is an issue with either the public or private file
-
-