public class OrientTokenHandler extends OServerPluginAbstract implements OTokenHandler
Modifier and Type | Field and Description |
---|---|
static String |
ENCRYPTION_ALGORITHM_DEFAULT |
static String |
ENCRYPTION_ALGORITHM_PAR |
protected static int |
JWT_DELIMITER |
static String |
SESSION_LENGHT_PAR |
static String |
SIGN_KEY_PAR |
TOKEN_HANDLER_NAME
Constructor and Description |
---|
OrientTokenHandler() |
Modifier and Type | Method and Description |
---|---|
void |
config(OServer iServer,
OServerParameterConfiguration[] iParams)
Configures the handler.
|
protected com.orientechnologies.orient.core.metadata.security.jwt.OJwtPayload |
createPayload(com.orientechnologies.orient.core.db.ODatabaseDocumentInternal db,
com.orientechnologies.orient.core.metadata.security.OSecurityUser user) |
protected OrientJwtHeader |
deserializeWebHeader(byte[] decodedHeader) |
protected com.orientechnologies.orient.core.metadata.security.jwt.OJwtPayload |
deserializeWebPayload(String type,
byte[] decodedPayload) |
protected com.orientechnologies.orient.core.metadata.security.jwt.OKeyProvider |
getKeyProvider() |
String |
getName() |
protected String |
getPayloadType(com.orientechnologies.orient.core.metadata.security.jwt.OJwtPayload payload) |
ONetworkProtocolData |
getProtocolDataFromToken(com.orientechnologies.orient.core.metadata.security.OToken token) |
long |
getSessionInMills() |
byte[] |
getSignedBinaryToken(com.orientechnologies.orient.core.db.ODatabaseDocumentInternal db,
com.orientechnologies.orient.core.metadata.security.OSecurityUser user,
ONetworkProtocolData data) |
byte[] |
getSignedWebToken(com.orientechnologies.orient.core.db.ODatabaseDocumentInternal db,
com.orientechnologies.orient.core.metadata.security.OSecurityUser user) |
boolean |
isEnabled() |
com.orientechnologies.orient.core.metadata.security.OToken |
parseBinaryToken(byte[] binaryToken) |
com.orientechnologies.orient.core.metadata.security.OToken |
parseWebToken(byte[] tokenBytes) |
byte[] |
renewIfNeeded(com.orientechnologies.orient.core.metadata.security.OToken token) |
protected byte[] |
serializeWebHeader(com.orientechnologies.orient.core.metadata.security.jwt.OJwtHeader header) |
protected byte[] |
serializeWebPayload(com.orientechnologies.orient.core.metadata.security.jwt.OJwtPayload payload) |
boolean |
validateBinaryToken(com.orientechnologies.orient.core.metadata.security.OToken token) |
boolean |
validateToken(com.orientechnologies.orient.core.metadata.security.OToken token,
String command,
String database) |
getContent, onAfterClientRequest, onBeforeClientRequest, onClientConnection, onClientDisconnection, onClientError, sendShutdown, shutdown, startup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContent, onAfterClientRequest, onBeforeClientRequest, onClientConnection, onClientDisconnection, onClientError, sendShutdown
public static final String SIGN_KEY_PAR
public static final String SESSION_LENGHT_PAR
public static final String ENCRYPTION_ALGORITHM_PAR
public static final String ENCRYPTION_ALGORITHM_DEFAULT
protected static final int JWT_DELIMITER
public void config(OServer iServer, OServerParameterConfiguration[] iParams)
OServerPlugin
config
in interface OServerPlugin
config
in class OServerPluginAbstract
public com.orientechnologies.orient.core.metadata.security.OToken parseWebToken(byte[] tokenBytes)
parseWebToken
in interface OTokenHandler
public boolean validateToken(com.orientechnologies.orient.core.metadata.security.OToken token, String command, String database)
validateToken
in interface OTokenHandler
public boolean validateBinaryToken(com.orientechnologies.orient.core.metadata.security.OToken token)
validateBinaryToken
in interface OTokenHandler
public byte[] getSignedWebToken(com.orientechnologies.orient.core.db.ODatabaseDocumentInternal db, com.orientechnologies.orient.core.metadata.security.OSecurityUser user)
getSignedWebToken
in interface OTokenHandler
public byte[] getSignedBinaryToken(com.orientechnologies.orient.core.db.ODatabaseDocumentInternal db, com.orientechnologies.orient.core.metadata.security.OSecurityUser user, ONetworkProtocolData data)
getSignedBinaryToken
in interface OTokenHandler
public ONetworkProtocolData getProtocolDataFromToken(com.orientechnologies.orient.core.metadata.security.OToken token)
getProtocolDataFromToken
in interface OTokenHandler
public com.orientechnologies.orient.core.metadata.security.OToken parseBinaryToken(byte[] binaryToken)
parseBinaryToken
in interface OTokenHandler
public String getName()
getName
in interface com.orientechnologies.common.util.OService
public byte[] renewIfNeeded(com.orientechnologies.orient.core.metadata.security.OToken token)
renewIfNeeded
in interface OTokenHandler
public long getSessionInMills()
public boolean isEnabled()
isEnabled
in interface OTokenHandler
protected OrientJwtHeader deserializeWebHeader(byte[] decodedHeader)
protected com.orientechnologies.orient.core.metadata.security.jwt.OJwtPayload deserializeWebPayload(String type, byte[] decodedPayload)
protected byte[] serializeWebHeader(com.orientechnologies.orient.core.metadata.security.jwt.OJwtHeader header) throws Exception
Exception
protected byte[] serializeWebPayload(com.orientechnologies.orient.core.metadata.security.jwt.OJwtPayload payload) throws Exception
Exception
protected com.orientechnologies.orient.core.metadata.security.jwt.OJwtPayload createPayload(com.orientechnologies.orient.core.db.ODatabaseDocumentInternal db, com.orientechnologies.orient.core.metadata.security.OSecurityUser user)
protected String getPayloadType(com.orientechnologies.orient.core.metadata.security.jwt.OJwtPayload payload)
protected com.orientechnologies.orient.core.metadata.security.jwt.OKeyProvider getKeyProvider()
Copyright © 2009–2016 Orient Technologies. All rights reserved.