public AuthResult authenticate ( String username , String password , String division ) { ensureConnection ( ) ; if ( isAuthenticated ( ) ) { return new AuthResult ( "0" ) ; } String av = username + ";" + password ; List < String > results = callRPCList ( "RGNETBRP AUTH:" + Constants . VERSION , null , connectionParams . getAppid ( ) , getLocalName ( ) , "" , // This is the pre-authentication token ";" . equals ( av ) ? av : Security . encrypt ( av , serverCaps . getCipherKey ( ) ) , getLocalAddress ( ) , division ) ; AuthResult authResult = new AuthResult ( results . get ( 0 ) ) ; if ( authResult . status . succeeded ( ) ) { setPostLoginMessage ( results . subList ( 2 , results . size ( ) ) ) ; init ( results . get ( 1 ) ) ; } return authResult ; }
Request authentication from the server .