I have a requirement to create an Alfresco user from the external application. Through Java API I need to write a external java class through which i need to create and validate that particular user inside Alfresco repository. Can anyone provide sample for this requirement.
I'd do this by writing a simple web script. The web script can use either the Java API or the JavaScript API to create a user. Your external app can then make a RESTful call to the web script.
Make sure your web script runs as "admin", either by requiring admin-level authentication or using runas (which would be a potential security hole), otherwise your code won't be executed with enough access to create the new user.