com.atlassian.connect.spring.internal.jwt.JwtParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of atlassian-connect-spring-boot-jwt Show documentation
Show all versions of atlassian-connect-spring-boot-jwt Show documentation
Provides JSON Web Token handling for Atlassian Connect for Spring Boot
The newest version!
package com.atlassian.connect.spring.internal.jwt;
import com.nimbusds.jose.JWSObject;
import com.nimbusds.jwt.JWTClaimsSet;
import java.text.ParseException;
public class JwtParser {
public JWTClaimsSet parse(String jwt) throws JwtParseException {
JWSObject jwsObject = parseJWSObject(jwt);
try {
return JWTClaimsSet.parse(jwsObject.getPayload().toString());
} catch (ParseException e) {
throw new JwtParseException(e);
}
}
public JWSObject parseJWSObject(String jwt) throws JwtParseException {
JWSObject jwsObject;
try {
jwsObject = JWSObject.parse(jwt);
} catch (ParseException e) {
throw new JwtParseException(e);
}
return jwsObject;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy