C
C
cat_crash2016-08-09 00:06:21
Angular
cat_crash, 2016-08-09 00:06:21

Yii2 + Angular - how to make authorization?

Good day
There is a frontend on Angular (site.com) and a backend on Yii2 (api.site.com)
How to do the authorization on the site through social services? Ideally, use the yii-user module ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2016-08-09
@AMar4enko

Correctly via satellizer
1. Tell satellizer "You need to log in via FB"
2. Satellizer starts the authorization process in a new window, if successful, gives us information about the logged in FB user, including the token and user id
3. Tell our server "Try to login FB-user with such-and-such an id and such-and-such a token"
4. The server, using the provided token, requests the user's profile from FB. Having received it, it compares the user id from the profile from FB and the user id received from the frontend. If they differ, they try to "throw" us.
5. If the identifiers match, it tries to find "our" user with the associated social network id. If not found, it creates a new user using the profile data received from the social network in step 4.
6. Returns the profile of "our" user, found or created in the previous step

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question