Skip to content

Commit 5433185

Browse files
committed
Merge pull request #4 from activecollab/fix-token-authentication-support
Stabilize support for token authentication
2 parents 6112bd3 + 5b4795c commit 5433185

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Adapter/Adapter.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ abstract class Adapter implements AdapterInterface
2424
* Return authentication credentials from request.
2525
*
2626
* @param ServerRequestInterface $request
27+
* @param bool $check_password
2728
* @return array
2829
*/
29-
protected function getAuthenticationCredentialsFromRequest(ServerRequestInterface $request)
30+
protected function getAuthenticationCredentialsFromRequest(ServerRequestInterface $request, $check_password = true)
3031
{
3132
$credentials = $request->getParsedBody();
3233

33-
if (!is_array($credentials) || empty($credentials['username']) || empty($credentials['password'])) {
34+
if (!is_array($credentials) || empty($credentials['username']) || ($check_password && empty($credentials['password']))) {
3435
throw new InvalidAuthenticateRequest();
3536
}
3637

0 commit comments

Comments
 (0)