public class JWTIDToken extends AbstractJWT
Constructor and Description |
---|
JWTIDToken(de.samply.common.config.OAuth2Client config,
String serialized)
|
JWTIDToken(String clientId,
PublicKey publicKey,
String serialized)
|
Modifier and Type | Method and Description |
---|---|
String |
getEmail()
Returns the users real email address
|
String |
getExternalLabel()
Returns the label of the external identity provider, might be null.
|
String |
getLanguage()
Returns the language the user selected in Samply.Auth.
|
String |
getName()
Returns the real name, or an empty string if this information is not available.
|
List<String> |
getRoles()
Returns a list of roles
|
protected String |
getTokenType()
This method must return one of the currently defined token types:
|
Usertype |
getUsertype()
Returns the usertype, one of "NORMAL", "REGISTRY", "BRIDGEHEAD".
|
boolean |
isValid()
Checks if this JWT is valid.
|
getClaimsSet, getPublicKey, getSerialized, getSubject
public JWTIDToken(de.samply.common.config.OAuth2Client config, String serialized) throws JWTException
config
- the OAuth2 client side configuration. The public key is needed to check the signature.serialized
- the serialized JWTJWTException
- if any error occurs during deserialization or signature verificationpublic JWTIDToken(String clientId, PublicKey publicKey, String serialized) throws JWTException
clientId
- publicKey
- serialized
- JWTException
public boolean isValid()
isValid
in class AbstractJWT
public String getEmail()
public String getName()
public String getLanguage()
public Usertype getUsertype()
public String getExternalLabel()
protected String getTokenType()
AbstractJWT
ACCESS_TOKEN ID_TOKEN REFRESH_TOKEN
getTokenType
in class AbstractJWT
Copyright © 2015 Universitätsmedizin Mainz, Abteilung IMBEI. All rights reserved.