|
|
using System;using System.Collections;using System.ComponentModel;using System.Data;using System.IO;namespace ManageUsersWSApp{class AuthenticateUserTest{[STAThread]static void Main(string[] args){try{// Create a AuthenticationManagerServiceService objectAuthenticationManagerServiceService svc = new AuthenticationManagerServiceService();// Provide authentication credentials to the servicesvc.Credentials = new System.Net.NetworkCredential("administrator","password");// Authenticate the userstring username = "administrator";string password = "password";char[] passwordchars = password.ToCharArray();byte[] passwordbytes = new byte[passwordchars.Length];for (int i = 0; i < passwordchars.Length; i++)passwordbytes[i] = (byte)(passwordchars[i]);AuthResult authResult = svc.authenticate(username, passwordbytes);// Get the authenticated user’s informationUser authUser = authResult.authenticatedUser;Console.WriteLine("Authenticated user’s canonical name: " + authUser.canonicalName);Console.WriteLine("Authenticated user’s domain name: " + authUser.domainName);}catch (Exception ee){Console.WriteLine("An unexpected exception was encountered: " + ee.Message + "\n" + ee.StackTrace);}}}}
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/quickStarts_UserManager.17.7.html