I
I
Igor Belikov2014-06-28 22:27:01
JavaScript
Igor Belikov, 2014-06-28 22:27:01

How to work with authorization in angularjs?

I want to clarify - is the following logic correct? I'm just dumb.

With local authorization (by login and password, for example), we received a token, saved it in cookies, in a session on the server, and now every time we go to a page or take any action, we send it with Ajax (UPD: add it to the header when requesting ) the token saved in cookies and check it on the server?

And the same logic with oauth, for example with google authorization - we went to the authorization confirmation page using the Google entry, we were thrown back and the received access_token was recorded in cookies and session, and then again we constantly check?

Is this the correct logic and are there any other options for solving this problem for this type of application like angular?

Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-06-28
@igorbelikov

The token must be sent in the headers of every request that requires authorization.
I recommend reading the discussion on SO

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question