All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.scalecube.security.tokens.jwt.jsonwebtoken.JsonwebtokenParserFactory Maven / Gradle / Ivy

There is a newer version: 1.0.33.rc1
Show newest version
package io.scalecube.security.tokens.jwt.jsonwebtoken;

import io.jsonwebtoken.JwtParserBuilder;
import io.jsonwebtoken.Jwts;
import io.scalecube.security.tokens.jwt.JwtTokenParser;
import io.scalecube.security.tokens.jwt.JwtTokenParserFactory;

public class JsonwebtokenParserFactory implements JwtTokenParserFactory {

  @Override
  public JwtTokenParser newParser(String token) {
    String justClaims = token.substring(0, token.lastIndexOf(".") + 1);
    JwtParserBuilder parserBuilder = Jwts.parserBuilder();
    return new JsonwebtokenParser(token, justClaims, parserBuilder);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy