Skip to content

Commit c6f8fff

Browse files
committed
feature #220 Remove authenticator BC layer (ajgarlag)
This PR was merged into the 0.10-dev branch. Discussion ---------- Remove authenticator BC layer Missing while removing Symfony <6.4 support Commits ------- 9734425 Remove authenticator BC layer
2 parents 6335193 + 9734425 commit c6f8fff

File tree

2 files changed

+1
-77
lines changed

2 files changed

+1
-77
lines changed

src/Security/Authenticator/ForwardCompatAuthenticatorTrait.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/Security/Authenticator/OAuth2Authenticator.php

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
2222
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
2323
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
24-
use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
2524
use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport;
2625
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
2726

@@ -30,12 +29,6 @@
3029
*/
3130
final class OAuth2Authenticator implements AuthenticatorInterface, AuthenticationEntryPointInterface
3231
{
33-
/**
34-
* @psalm-suppress UndefinedTrait
35-
* @psalm-suppress MethodSignatureMismatch
36-
*/
37-
use ForwardCompatAuthenticatorTrait;
38-
3932
private HttpMessageFactoryInterface $httpMessageFactory;
4033
private ResourceServer $resourceServer;
4134
private UserProviderInterface $userProvider;
@@ -63,10 +56,7 @@ public function start(Request $request, ?AuthenticationException $authException
6356
return new Response($authException?->getMessage() ?? 'Authentication required', 401, ['WWW-Authenticate' => 'Bearer']);
6457
}
6558

66-
/**
67-
* @return Passport
68-
*/
69-
public function doAuthenticate(Request $request) /* : Passport */
59+
public function authenticate(Request $request): Passport
7060
{
7161
try {
7262
$psr7Request = $this->resourceServer->validateAuthenticatedRequest($this->httpMessageFactory->createRequest($request));
@@ -105,30 +95,6 @@ public function doAuthenticate(Request $request) /* : Passport */
10595
return $passport;
10696
}
10797

108-
/**
109-
* @return OAuth2Token
110-
*
111-
* @psalm-suppress DeprecatedInterface
112-
* @psalm-suppress UndefinedClass
113-
* @psalm-suppress MixedInferredReturnType
114-
* @psalm-suppress RedundantCondition
115-
*/
116-
public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface
117-
{
118-
if (!$passport instanceof Passport) {
119-
throw new \RuntimeException(\sprintf('Cannot create a OAuth2 authenticated token. $passport should be a %s', Passport::class));
120-
}
121-
122-
$token = $this->createToken($passport, $firewallName);
123-
/**
124-
* @psalm-suppress TooManyArguments
125-
* @psalm-suppress UndefinedMethod
126-
*/
127-
$token->setAuthenticated(true);
128-
129-
return $token;
130-
}
131-
13298
/**
13399
* @return OAuth2Token
134100
*/

0 commit comments

Comments
 (0)