Authenticating against identity api

Authenticates against identity api and redirects to the request_uri on success, or back to the login page on failure.

/review @dbelwood