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
// get the user to be authenticated$user = ...;
// log the user in on the current firewall$security->login($user);
// if the firewall has more than one authenticator, you must pass it explicitly// by using the name of built-in authenticators...$security->login($user, 'form_login');
// ...or the service id of custom authenticators$security->login($user, ExampleAuthenticator::class);
// you can also log in on a different firewall...$security->login($user, 'form_login', 'other_firewall');
// ...and add badges$security->login($user, 'form_login', 'other_firewall', [(newRememberMeBadge())->enable()]);
// use the redirection logic applied to regular login$redirectResponse = $security->login($user);
return$redirectResponse;
...
{% if is_granted('ROLE_API') %}
{# tried both this and the below code leads to the same #}
{% endif %}
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
App Version: {{ app_version }}
{% endif %}
...
so the old code to autologin doesn't work any more or does not work with the acces token handler. the code from above fails silently, the user is simply not logged in (as far as i can verify).
switching to a custom code which uses the new security helper and its locin helper cest:
TavoNiievez
changed the title
amLoggedInAs with symfony 7.0 does not work
amLoggedInAs with symfony 7.0 does not work with the acces token handler
Apr 24, 2024
symfony changed their security again. the code to do the automated login looks like that:
https://symfony.com/doc/7.0/security.html#login-programmatically
having the following config:
security.yaml
src/Security/AccessTokenHandler.php
version.html.twig
cest
so the old code to autologin doesn't work any more or does not work with the acces token handler. the code from above fails silently, the user is simply not logged in (as far as i can verify).
switching to a custom code which uses the new security helper and its locin helper
cest
:services.yaml
:leads to
i wanted to try to set the header for this request but only found Codeception/Codeception#5308
any thoughts?
The text was updated successfully, but these errors were encountered: