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

Appearance settings

Commit 3f60598

Browse filesBrowse files
SofHadfabpot
authored andcommitted
[Security] add USERNAME_NONE_PROVIDED constant
1 parent 0974606 commit 3f60598
Copy full SHA for 3f60598

File tree

Expand file treeCollapse file tree

3 files changed

+9
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-2
lines changed

‎src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
*/
2525
interface AuthenticationProviderInterface extends AuthenticationManagerInterface
2626
{
27+
/**
28+
* Use this constant for not provided username
29+
*
30+
* @var string
31+
*/
32+
const USERNAME_NONE_PROVIDED = 'NONE_PROVIDED';
33+
2734
/**
2835
* Checks whether this provider supports the given token.
2936
*

‎src/Symfony/Component/Security/Core/Authentication/Provider/LdapBindAuthenticationProvider.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Provider/LdapBindAuthenticationProvider.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct(UserProviderInterface $userProvider, UserCheckerInte
5858
*/
5959
protected function retrieveUser($username, UsernamePasswordToken $token)
6060
{
61-
if ('NONE_PROVIDED' === $username) {
61+
if (AuthenticationProviderInterface::USERNAME_NONE_PROVIDED === $username) {
6262
throw new UsernameNotFoundException('Username can not be null');
6363
}
6464

‎src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function authenticate(TokenInterface $token)
6363

6464
$username = $token->getUsername();
6565
if ('' === $username || null === $username) {
66-
$username = 'NONE_PROVIDED';
66+
$username = AuthenticationProviderInterface::USERNAME_NONE_PROVIDED;
6767
}
6868

6969
try {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.