Skip to content

Commit

Permalink
added InteractiveLoginEvent support
Browse files Browse the repository at this point in the history
  • Loading branch information
konradoboza committed Jun 6, 2024
1 parent 89c306e commit 53a8093
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/Security/Authenticator/RestAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\Authenticator\AbstractAuthenticator;
use Symfony\Component\Security\Http\Authenticator\InteractiveAuthenticatorInterface;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;

final class RestAuthenticator extends AbstractAuthenticator
final class RestAuthenticator extends AbstractAuthenticator implements InteractiveAuthenticatorInterface
{
private const string ACCEPT_HEADER = 'Accept';
private const string CONTENT_TYPE_HEADER = 'Content-Type';
Expand Down Expand Up @@ -93,6 +94,11 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
throw $exception;
}

public function isInteractive(): bool
{
return true;
}

private function fetchExistingToken(Request $request): ?TokenInterface
{
// If a token already exists and username is the same as the one we request authentication for,
Expand Down

0 comments on commit 53a8093

Please sign in to comment.