-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unclear how to implement 'login_check' route #5
Comments
However, this bundle uses the I usually add something like this in order to be able to generate the route and have a fallback implementation for when the provider can't handle the request. /**
* This route handles every login request
* Only this route is listened to by the security services, so another route is not possible
*
* @Route("/#_check", name="login_check")
* @IsGranted("IS_AUTHENTICATED_ANONYMOUSLY")
*/
public function checkLogin(): RedirectResponse
{
if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
return $this->redirect($this->generateUrl('homepage'));
} else {
return $this->redirect($this->generateUrl('login'));
}
} I'll see if I can add this to the docs after you've confirmed this works for you 👍🏻 |
Thanks for your swift response, this fixes the issue. I'm not explicitely using or providing the |
Nah, that is because its the default value in the OidcClient constructor: symfony-oidc/src/OidcClient.php Line 86 in 0f9ef05
Even if you weren't using Guard but the more outdated methods this bundle uses, the route name wouldn't exist by default. Anyways, somewhere in the (near) future we need to update this bundle to be able to work with Symfony 6 and the new authentication implementation anyways. For now, I will add a link to this issue in the documentation for when anyone else encounters this particular issue. |
Currently, I'm trying to implement an OIDC client flow using this bundle. After following the steps provided in the readme, I've received an "Unable to generate a URL for the named route "login_check" as such route does not exist." error. After checking out the source code, it has become clear that the login_check route is used to verify the returned authorization code. However, this is step is currently undocumented.
The text was updated successfully, but these errors were encountered: