How to solve the problem of not working single sign-on authentication?

I use advanced app and made in your project in a single sign, then tried to login on the frontend everything seems fine, but when logged in backend user was not logged-decided to try to login on the backend to check, but it turned out that the authorization does not work, just redirected to the main page not logged -.
Here is the code of the file backend main.php(all that relates to authentication)

'request' => [
 'csrfParam' => '_csrf-backend',
 'cookieValidationKey' => $params['cookieValidationKey'],
],
 'user' => [
 'identityClass' => 'common\models\User',
 'enableAutoLogin' => true,
 'identityCookie' => [
 'name' => '_identity',
 'httpOnly' => true,
 'domain' => $params['cookieDomain'],
],
],
 'session' => [
 // this is the name of the session cookie used for login on the backend
 'name' => '_session',
 'cookieParams' => [
 'domain' => $params['cookieDomain'],
 'httpOnly' => true,
],
 ],


Here is the code of the file frontend main.php(all that relates to authentication)

'request' => [
 'csrfParam' => '_csrf-frontend',
 'cookieValidationKey' => $params['cookieValidationKey'],
],
 'user' => [
 'identityClass' => 'common\models\User',
 'enableAutoLogin' => true,
 'identityCookie' => [
 'name' => '_identity',
 'httpOnly' => true,
 'domain' => $params['cookieDomain'],
],
],
 'session' => [
 // this is the name of the session cookie used for login on the frontend
 'name' => '_session',
 'cookieParams' => [
 'domain' => $params['cookieDomain'],
 'httpOnly' => true,
],
 ],
June 8th 19 at 16:44
1 answer
June 8th 19 at 16:46
Solution
front and back different domains? more likely that cook put on the front.
Yes, different - destin.Hu commented on June 8th 19 at 16:49
And how to cook can be placed here on the front? - destin.Hu commented on June 8th 19 at 16:52
quite different or domains of level 3 (cabinet.site.ru) ? if so then you cook can be put on *.site.ru then everything will be OK - Mitchell_Zemlak16 commented on June 8th 19 at 16:55
I have two domain blog.loc, blog-backend.loc - destin.Hu commented on June 8th 19 at 16:58
I tried the file common\config\params-local.php change to *.blog.loc didn't work - destin.Hu commented on June 8th 19 at 17:01
on different domains will not work, you should have one primary domain lead. you can not cook with one domain to use on another. - Mitchell_Zemlak16 commented on June 8th 19 at 17:04

Find more questions by tags Yii