You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a running container inside my server which rans on 1285 port.
I use Apache2 reverse proxy to serve that instance through 80 port on my specific domain and then apply SSL certificate there.
And I have this code as my Symfony authenticator
MyGoogleAuthenticator.php
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
{
$targetUrl = $this->router->generate(name: 'admin', referenceType: UrlGeneratorInterface::RELATIVE_PATH);
/** @var User $user */
$user = $token->getUser();
$this->userLogService->logUserLogin($user, $request->getClientIp());
return new RedirectResponse($targetUrl);
}
public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response
{
$this->flashBag->add('danger', 'User is not registered');
$targetUrl = $this->router->generate(name: 'app_login', referenceType: UrlGeneratorInterface::RELATIVE_PATH);
return new RedirectResponse($targetUrl);
}
/**
* Link to this controller to start the "connect" process.
*
* @Route("/connect/google", name="connect_google_start")
*/
public function connectAction(ClientRegistry $clientRegistry): RedirectResponse
{
if (!$this->settingsReadService->isGoogleLoginEnabled()) {
throw new \Exception('Google login is not enabled');
}
return $clientRegistry
->getClient('google') // key used in config/packages/knpu_oauth2_client.yaml
->redirect([
'openid', 'email', 'profile', // the scopes you want to access
], []);
}
/**
* After going to Google, you're redirected back here
* because this is the "redirect_route" you configured
* in config/packages/knpu_oauth2_client.yaml.
*
* @Route("/connect/google/check", name="connect_google_check")
*/
public function connectCheckAction(Request $request, ClientRegistry $clientRegistry)
{
}
I have a running container inside my server which rans on 1285 port.
I use Apache2 reverse proxy to serve that instance through 80 port on my specific domain and then apply SSL certificate there.
And I have this code as my Symfony authenticator
What I do:
How I want it to work:
What is the correct or recommended way of achieving this?
The text was updated successfully, but these errors were encountered: