public final class OAuthUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
WEBID |
static String |
WEBSITE |
Modifier and Type | Method and Description |
---|---|
static Authenticator |
buildAuthenticatorWithJwk(String location)
Build an authenticator.
|
static Authenticator |
buildAuthenticatorWithSharedSecret(String key)
Build an authenticator.
|
static Authenticator |
buildAuthenticatorWithTruststore(String keystorePath,
char[] keystorePassword,
List<String> keyids)
Build an authenticator.
|
static Key |
buildRSAPublicKey(String keyType,
BigInteger modulus,
BigInteger exponent)
Build an RSA public key.
|
static Principal |
withSubjectClaim(io.jsonwebtoken.Claims claims)
Generate a Principal from a subject claim.
|
static Principal |
withWebIdClaim(io.jsonwebtoken.Claims claims)
Generate a Principal from a webid claim.
|
public static final String WEBID
public static final String WEBSITE
public static Principal withWebIdClaim(io.jsonwebtoken.Claims claims)
claims
- the JWT claimspublic static Principal withSubjectClaim(io.jsonwebtoken.Claims claims)
claims
- the JWT claimspublic static Authenticator buildAuthenticatorWithJwk(String location)
location
- the key locationpublic static Key buildRSAPublicKey(String keyType, BigInteger modulus, BigInteger exponent)
keyType
- the algorithm (should be "RSA")modulus
- the modulusexponent
- the exponentpublic static Authenticator buildAuthenticatorWithSharedSecret(String key)
key
- the keypublic static Authenticator buildAuthenticatorWithTruststore(String keystorePath, char[] keystorePassword, List<String> keyids)
keystorePath
- the path to a keystorekeystorePassword
- the password for a keystorekeyids
- the key ids