public void SetPassword( UserLogin user, string password )
{
var entityType = EntityTypeCache.Read( user.EntityTypeId ?? 0);
var authenticationComponent = AuthenticationContainer.GetComponent( entityType.Name );
if ( authenticationComponent == null || !authenticationComponent.IsActive )
throw new Exception( string.Format( "'{0}' service does not exist, or is not active", entityType.FriendlyName ) );
if ( authenticationComponent.ServiceType == AuthenticationServiceType.External )
throw new Exception( "Cannot change password on external service type" );
authenticationComponent.SetPassword( user, password );
user.LastPasswordChangedDateTime = RockDateTime.Now;
}