so here’s the thing
I have two apps
there is login button in the first app. If the button is clicked, the user will be automatically logged in to the second app
and if the user logs himself out from the second app, he will be redirected to Auth0 authentication
the problem I’m having now is when a user clicks the login button from the first app, he will be redirected to Auth0 authentication. This is not expected. He should be automatically logged in to the second app
I can’t find a way to automatically log him in on the PHP (Laravel) SDK
How do I do it?
Btw, the first app and the second app use PHP. (Wordpress and Laravel-with Auth0 integrated, respectively)
So, if I’ve understood correctly, the flow you’ve tested and described is:
The user logins via first app. A consequence of this is that the user is logged in to the second app too. → This is expected due to our seamless SSO between applications that are integrated in the same Auth0 tenant and have the same database enabled.
The user logs out from the second app, being redirected to your Auth0 login page. → Please note, if you’ve used our /logout endpoint, then the user will be logged out from your Auth0 tenant - from all applications. You might want to read Logout to fully understand this.
The user now goes and clicks on the login button from the first app, being redirected to your Auth0 login page. → This is actually expected, since the user logged out in the previous step. When logging out from the second application, the SSO Cookie was cleared and hence the user was logged out from all applications (Auth0 Session layer)
In conclusion, if I’ve understood your flow correctly (sorry if not), everything is working as expected. You might want to read the logout documentation I mentioned in step #2 or even better, Session Layers to fully understand how sessions work.
Regarding your question:
The reason why the user was not logged in automatically when calling the /authorize endpoint is because there was no active Auth0 session anymore.