8000 Update custom_authentication_provider.rst · symfony/symfony-docs@70452ae · GitHub
[go: up one dir, main page]

Skip to content

Commit 70452ae

Browse files
lucchese-pdjaviereguiluz
authored andcommitted
Update custom_authentication_provider.rst
1 parent c948ca5 co
10000
mmit 70452ae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

security/custom_authentication_provider.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,17 @@ set an authenticated token in the token storage if successful::
130130
{
131131
$request = $event->getRequest();
132132

133-
$wsseRegex = '/UsernameToken Username="([^"]+)", PasswordDigest="([^"]+)", Nonce="([a-zA-Z0-9+\/]+={0,2})", Created="([^"]+)"/';
133+
$wsseRegex = '/UsernameToken Username="(?P<username>[^"]+)", PasswordDigest="(?P<digest>[^"]+)", Nonce="(?P<nonce>[a-zA-Z0-9+\/]+={0,2})", Created="(?P<created>[^"]+)"/';
134134
if (!$request->headers->has('x-wsse') || 1 !== preg_match($wsseRegex, $request->headers->get('x-wsse'), $matches)) {
135135
return;
136136
}
137137

138138
$token = new WsseUserToken();
139-
$token->setUser($matches[1]);
139+
$token->setUser($matches['username']);
140140

141-
$token->digest = $matches[2];
142-
$token->nonce = $matches[3];
143-
$token->created = $matches[4];
141+
$token->digest = $matches['digest'];
142+
$token->nonce = $matches['nonce'];
143+
$token->created = $matches['created'];
144144

145145
try {
146146
$authToken = $this->authenticationManager->authenticate($token);

0 commit comments

Comments
 (0)
0