Package com.symphony.api.bindings
Class JWTHelper
- java.lang.Object
-
- com.symphony.api.bindings.JWTHelper
-
public class JWTHelper extends Object
Constructs a JWT token for use with Symphony RSA authentication.- Author:
- Rob Moffat
-
-
Field Summary
Fields Modifier and Type Field Description static String
JWT_CLAIMS
static String
JWT_HEADER
-
Constructor Summary
Constructors Constructor Description JWTHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
createSignedJwt(String user, long expiration, PrivateKey privateKey)
static String
createSignedJwt(String user, PrivateKey privateKey)
static String
createSignedJwtFromClaims(String constructedClaims, PrivateKey privateKey)
static String
decodeJwt(String in)
-
-
-
Method Detail
-
createSignedJwt
public static String createSignedJwt(String user, PrivateKey privateKey) throws Exception
- Throws:
Exception
-
createSignedJwt
public static String createSignedJwt(String user, long expiration, PrivateKey privateKey) throws Exception
- Parameters:
user
- Common Name of Symphony Userexpiration
- Seconds from epoch (1.1.1970) to expiryprivateKey
- your RSA private key, matching the public key on the pod.- Throws:
Exception
-
createSignedJwtFromClaims
public static String createSignedJwtFromClaims(String constructedClaims, PrivateKey privateKey) throws Exception
- Throws:
Exception
-
-