Add auth.

Implement auth by tokens and cookies.