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
Fatal error:
The first argument of "HWI\Bundle\OAuthBundle\Security\Http\Authenticator\OAuthAuthenticator::createAuthenticatedToken" must be instance of "HWI\Bundle\OAuthBundle\Security\Http\Authenticator\Passport\SelfValidatedOAuthPassport", "Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport" provided.
Expected Behavior
Authenticate the user. We use this in tests to have a fake user logged in. This previously worked with 1.4.x
Steps to Reproduce
use HWI\Bundle\OAuthBundle\Security\Core\User\OAuthUser;
use HWI\Bundle\OAuthBundle\Security\Http\Authenticator\OAuthAuthenticator;
use Symfony\Bundle\SecurityBundle\Security\UserAuthenticator;
use Symfony\Component\HttpFoundation\Request;
class FakeLoginController
{
public function __construct(
private readonly OAuthAuthenticator $authenticator,
private readonly UserAuthenticator $userAuthenticator,
) {
}
public function fakeLogin(Request $request)
{
return $this->userAuthenticator->authenticateUser(new OAuthUser('fake.user@fakedomain.nl'), $this->authenticator, $request);
}
}
The text was updated successfully, but these errors were encountered:
This is a bit more complicated because the authenticateUser() method has a hardcoded relation to Symfony SelfValidatedOAuthPassport class, while this bundle supports a much wider amount of Symfony versions has its class with BC code (for Symfony 5.4), second thing is that we store there OAuthToken to use it internally.
That's the reason for the fatal error when using Symfony authenticator with HWI one possible solution could be the usage of a custom badge to hold OAuthToken instead of a passport.
Actual Behavior
Expected Behavior
Authenticate the user. We use this in tests to have a fake user logged in. This previously worked with 1.4.x
Steps to Reproduce
The text was updated successfully, but these errors were encountered: