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

Skip to content

Commit 0ac1a8d

Browse files
authored
Update custom_authentication_provider.rst
1 parent 8fe5054 commit 0ac1a8d

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
@@ -131,17 +131,17 @@ set an authenticated token in the token storage if successful::
131131
{
132132
$request = $event->getRequest();
133133

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

139139
$token = new WsseUserToken();
140-
$token->setUser($matches[1]);
140+
$token->setUser($matches['username']);
141141

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

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

0 commit comments

Comments
 (0)
0