Examples of JwtSigner


Examples of com.auth0.jwt.JwtSigner

  public String generateToken(Object object, int expiration) {

    String payload, token;
    try {
   
      JwtSigner jwtSigner = new JwtSigner();
      payload = new  ObjectMapper().writeValueAsString(object);

        ClaimSet claimSet = new ClaimSet();
        claimSet.setExp(expiration); // expire in 1 year
       
        token = jwtSigner.encode(Algorithm.HS256, payload, "payload", new String(Base64.decodeBase64(clientSecret)), claimSet);
   
    } catch (JsonProcessingException e) {
      throw new Auth0RuntimeException(e);
    } catch (Exception e) {
      throw new Auth0RuntimeException(e);
View Full Code Here

Examples of com.auth0.jwt.JwtSigner

   * Create a JSON web token by serializing a java object
   */
  public String encode(Algorithm algorithm, Object obj, String secret,
      ClaimSet claimSet) throws Exception {
   
    JwtSigner jwtSigner = new JwtSigner();
    String payload = getPayloadHandler().encoding(obj);
   
    return jwtSigner.encode(algorithm, payload, PAYLOAD_ID, secret, claimSet);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.