S
S
Sergey Shvab2019-09-28 16:54:10
User identification
Sergey Shvab, 2019-09-28 16:54:10

What is the best way to make common authorization for different applications (wordpress and yii2)?

GENERAL INFORMATION:
- There are two applications. One for wordpress and one for yii2 .
- Located on the same domain, wp on the main, yii2 on a subdomain (cookies exist for the whole domain with subdomains)
- Use one database. The table of users from wp is taken as a basis.
- Use wp login to log in
WHAT IS NEEDED :
Authorize user in yii application if he is logged in wp
PROBLEM POINT :
How to get information about authorized user in WP on yii2 side of application?
It turns out that I need to check whether the user is authorized in WP and get his ID in order to authorize him in YII2 or log out if necessary.
What is the best way to do this? Calling the REST API (if so, how to get the nonce so that the request returns the correct information)?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question