use of com.orientechnologies.orient.core.metadata.security.OSecurityUser in project orientdb by orientechnologies.
the class OTokenHandlerImplTest method testTokenNotRenew.
@Test
public void testTokenNotRenew() {
ODatabaseDocumentTx db = new ODatabaseDocumentTx("memory:" + OTokenHandlerImplTest.class.getSimpleName());
db.create();
try {
OSecurityUser original = db.getUser();
OTokenHandlerImpl handler = new OTokenHandlerImpl("any key".getBytes(), 60, "HmacSHA256");
ONetworkProtocolData data = new ONetworkProtocolData();
data.driverName = "aa";
data.driverVersion = "aa";
data.serializationImpl = "a";
data.protocolVersion = 2;
byte[] token = handler.getSignedBinaryToken(db, original, data);
OToken tok = handler.parseBinaryToken(token);
token = handler.renewIfNeeded(tok);
assertEquals(0, token.length);
} finally {
db.drop();
}
}
Aggregations