8000 minor #9502 Update custom_authentication_provider.rst (lucchese-pd) · symfony/symfony-docs@f36e023 · GitHub
[go: up one dir, main page]

Skip to content

Commit f36e023

Browse files
committed
minor #9502 Update custom_authentication_provider.rst (lucchese-pd)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #9502). Discussion ---------- Update custom_authentication_provider.rst <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 70452ae Update custom_authentication_provider.rst
2 parents c948ca5 + 70452ae commit f36e023

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