moved authenticate to service
Merged from web