Package io.continual.iam.credentials
Class JwtCredential
- java.lang.Object
-
- io.continual.iam.credentials.JwtCredential
-
public class JwtCredential extends Object
A JWT credential.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJwtCredential.InvalidJwtToken
-
Constructor Summary
Constructors Constructor Description JwtCredential(String jwtToken)Build a JWT credential from a token with an sha256 key used for signingJwtCredential(String jwtToken, boolean checkExpired)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JwtCredentialfromHeader(String authHeader)Build a JWT credential from a header value (normally Authorization)StringgetIssuer()StringgetSignature()StringgetSignedContent()StringgetSigningAlgorithm()StringgetSubject()booleanisForAudience(String aud)StringtoBearerString()StringtoString()
-
-
-
Constructor Detail
-
JwtCredential
public JwtCredential(String jwtToken) throws JwtCredential.InvalidJwtToken
Build a JWT credential from a token with an sha256 key used for signing- Parameters:
jwtToken- a token- Throws:
JwtCredential.InvalidJwtToken- when the token is invalid
-
JwtCredential
public JwtCredential(String jwtToken, boolean checkExpired) throws JwtCredential.InvalidJwtToken
- Throws:
JwtCredential.InvalidJwtToken
-
-
Method Detail
-
fromHeader
public static JwtCredential fromHeader(String authHeader) throws JwtCredential.InvalidJwtToken
Build a JWT credential from a header value (normally Authorization)- Parameters:
authHeader- the authentication header value- Returns:
- a JwtCredential
- Throws:
JwtCredential.InvalidJwtToken- when the token is invalid
-
toBearerString
public String toBearerString()
-
getSignedContent
public String getSignedContent()
-
getSignature
public String getSignature()
-
getSubject
public String getSubject()
-
getIssuer
public String getIssuer()
-
isForAudience
public boolean isForAudience(String aud)
-
getSigningAlgorithm
public String getSigningAlgorithm()
-
-