M
M
McMike2017-03-22 14:03:09
Yii
McMike, 2017-03-22 14:03:09

Is it possible to make authorization on different domains using standard Yii2 tools?

There are 2 domains (look in one DB). You need to be authorized on one, be authorized on the other when you switch to it.
Can this be done using standard Yii2 tools?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-03-22
@webinar

If the server is 1 (let's say backend and frontend on different domains), then you can, for example, in the backend config

'components' => [
        'cache' => [
            'class' => 'yii\caching\FileCache',
            'cachePath' => '@frontend/runtime/cache' //делаем общий кеш
        ],
        'request' => [
            'csrfParam' => '_csrf-myap', //тоже делаем такое же как и на frontend
            'cookieValidationKey' => 'nk34HGdd8w6rf', //тоже делаем такое же как и на frontend
        ],

It should work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question