Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdb8e01a

Browse files
Sam HudsonSam Hudson
Sam Hudson
authored and
Sam Hudson
committed
recommendations by xabbuh
1 parent3366dfc commitdb8e01a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

‎cookbook/security/api_key_authentication.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,20 @@ exception in ``refreshUser()``.
213213
Handling Authentication Failure
214214
-------------------------------
215215

216-
In order foryour ``ApiKeyAuthentication`` to correctly display a 403
217-
http status when either bad credentials, or authentication fails - you will
218-
need to implement the``AuthenticationFailureHandlerInterface`` on your
216+
In order foryou're ``ApiKeyAuthentication`` to correctly display a 403
217+
http status when either bad credentials or authentication fails you will
218+
need to implement the:class:`Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface` on your
219219
Authenticator. This will provide a method ``onAuthenticationFailure`` which
220-
you canthen return a``Response`` with.
220+
you canuse to create an error``Response``.
221221

222222
// src/Acme/HelloBundle/Security/ApiKeyAuthenticator.php
223223
namespace Acme\HelloBundle\Security;
224224

225+
use Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface;
226+
use Symfony\Component\Security\Core\Exception\AuthenticationException;
225227
use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
226228
use Symfony\Component\HttpFoundation\Response;
229+
use Symfony\Component\HttpFoundation\Request;
227230

228231
class ApiKeyAuthenticator implements SimplePreAuthenticatorInterface, AuthenticationFailureHandlerInterface
229232
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp