static void Main(string[] args) { // 1. Establish a connection to DeployR. // // This example assumes the DeployR server is running on localhost. // String deployrEndpoint = "http://localhost:7400/deployr"; RClient rClient = RClientFactory.createClient(deployrEndpoint); // // 2. Authenticate an end-user or client application. // // The RBasicAuthentication supports basic username/password authentication. // The RUser returned represents an authenticated end-user or application. // RAuthentication authToken = new RBasicAuthentication("testuser", "changeme"); RUser rUser = rClient.login(authToken); // // 3. Logout the user // // The authenticated user is logged out from the DeployR server // rClient.logout(rUser); }
static public RUser Authenticate(RClient rClient) { // // Authenticate an end-user or client application. // // The RBasicAuthentication supports basic username/password authentication. // The RUser returned represents an authenticated end-user or application. // RAuthentication authToken = new RBasicAuthentication("testuser", "changeme"); RUser rUser = rClient.login(authToken); Console.WriteLine("User Authenticated: user: " + rUser.about().Username); return(rUser); }