Raven.Bundles.Authentication.AuthenticateClient.Authenticate C# (CSharp) Method

Authenticate() public method

public Authenticate ( DocumentDatabase currentStore, string username, string password, string &allowedDatabases ) : bool
currentStore Raven.Database.DocumentDatabase
username string
password string
allowedDatabases string
return bool
		public bool Authenticate(DocumentDatabase currentStore, string username, string password, out string[] allowedDatabases)
		{
			allowedDatabases = new string[0];

			var jsonDocument = ((DocumentDatabase)currentStore).Get("Raven/Users/"+username, null);
			if (jsonDocument == null)
			{
				return false;
			}

			var user = jsonDocument.DataAsJson.JsonDeserialization<AuthenticationUser>();

			var validatePassword = user.ValidatePassword(password);
			if (validatePassword)
				allowedDatabases = user.AllowedDatabases;

			return validatePassword;
		}
AuthenticateClient