public class TokenGenerator extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
log |
protected static List<RSAPublicKey> |
publicKeys |
| Modifier and Type | Method and Description |
|---|---|
Certificate |
fetchServerCertificate()
fetches the server certificates from the remote CN using the configured CN baseurl from
d1_libclient_java.
|
static TokenGenerator |
getInstance() |
String |
getJWT(String userId,
String fullName) |
org.dataone.service.types.v1.Session |
getSession(String token)
Uses configured public keys to verify provided token.
|
static void |
main(String[] args)
For generating custom tokens outside the portal workflow.
|
protected void |
setPublicKeys() |
public static org.apache.commons.logging.Log log
protected static List<RSAPublicKey> publicKeys
public static TokenGenerator getInstance() throws IOException
IOExceptionpublic Certificate fetchServerCertificate()
public String getJWT(String userId, String fullName) throws com.nimbusds.jose.JOSEException, ParseException, IOException
com.nimbusds.jose.JOSEExceptionParseExceptionIOExceptionprotected void setPublicKeys()
throws IOException
IOExceptionpublic org.dataone.service.types.v1.Session getSession(String token)
token - the given JWT token stringpublic static void main(String[] args)
args - command-line arguments: Copyright © 2024. All rights reserved.