bshaffer / oauth2-server-php

A library for implementing an OAuth2 Server in php
http://bshaffer.github.io/oauth2-server-php-docs
MIT License
3.26k stars 950 forks source link

bug: when using pdo, the server gives auth code instead of error if the client doesn't specify a scope in request #992

Open githubeing opened 4 years ago

githubeing commented 4 years ago

in pdo storage, if there's no default scope, the method returns null: https://github.com/bshaffer/oauth2-server-php/blob/master/src/OAuth2/Storage/Pdo.php#L521

but in authorization controller, there's a strict type comparison with false, not null: https://github.com/bshaffer/oauth2-server-php/blob/master/src/OAuth2/Controller/AuthorizeController.php#L320

- therefore, instead of returning an error 'invalid_client', 'This application requires you specify a scope parameter', the auth controller returns an auth code if a client haven't specify a scope in their request.

could you please fix this?