login in rest api

Restrict api usage on user’s login.