search: keywords: ['Java API', 'OServer', 'authenticate server user', 'authenticate']

OServer - authenticate()

This method authenticates a user on the OrientDB Server.

Authenticating Users

OrientDB differentiates between users that operate on the server and users that operate on the database. This method allows you to authenticate the given user for server operations.

Syntax

public boolean OServer().authenticate(String user, String passwd, String resource)
ArgumentTypeDescription
userjava.lang.StringDefines the user to authenticate.
passwdjava.lang.StringDefines the password for the user.
resourcejava.lang.StringDefines the resource to authenticate on.

Return Value

This method returns a boolean value. If the return value is true, it indicates that you have successfully authenticated the user.

Example

Imagine you have a web application running on a distributed deployment. You may want a method in the class that manages your OrientDB Server instances to use in authenticating server users.


/**
 * Authenticate User
 */
public Boolean authUser(OServer oserver, 
      String user, String passwd, String resource){ 
    
   // Log Operation
   logger.info("Authenticating User: " + user);

   return oserver.authenticate(ser, passwd, resorce);
}