Neil Dsouza
Neil Dsouza

Reputation: 11

[orientdb]: get the current user when authenticating with tokens

How can i get the rid of the current user (OUser) via the binary api. I am using the inbuilt token based authentication. I would expect two approaches:

Upvotes: 1

Views: 126

Answers (1)

TheMalloum
TheMalloum

Reputation: 23

I find your post just now, may be is too late but you can do like this:


OServer server = OServerMain.create(); //  for exemple

ODatabaseDocumentTx db = new ODatabaseDocumentTx(BDDURL).open("admin","admin"); // admin is juste for this exemple

OTokenHandlerImpl handler = new OTokenHandlerImpl(server);

OToken tok = handler.parseWebToken(yourtoken);

OUser user =  tok.getUser(db);

Upvotes: 0

Related Questions