Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14056285
D11696.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11696.diff
View Options
diff --git a/src/applications/oauthserver/controller/PhabricatorOAuthServerAuthController.php b/src/applications/oauthserver/controller/PhabricatorOAuthServerAuthController.php
--- a/src/applications/oauthserver/controller/PhabricatorOAuthServerAuthController.php
+++ b/src/applications/oauthserver/controller/PhabricatorOAuthServerAuthController.php
@@ -39,8 +39,23 @@
// one giant try / catch around all the exciting database stuff so we
// can return a 'server_error' response if something goes wrong!
try {
- $client = id(new PhabricatorOAuthServerClient())
- ->loadOneWhere('phid = %s', $client_phid);
+ try {
+ $client = id(new PhabricatorOAuthServerClientQuery())
+ ->setViewer($viewer)
+ ->withPHIDs(array($client_phid))
+ ->executeOne();
+ } catch (PhabricatorPolicyException $ex) {
+ // We require that users must be able to see an OAuth application
+ // in order to authorize it. This allows an application's visibility
+ // policy to be used to restrict authorized users.
+
+ // None of the OAuth error responses are a perfect fit for this, but
+ // 'invalid_client' seems closest.
+ return $this->buildErrorResponse(
+ 'invalid_client',
+ pht('Not Authorized'),
+ pht('You are not authorized to authenticate.'));
+ }
if (!$client) {
return $this->buildErrorResponse(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 7:35 PM (2 d, 17 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6739681
Default Alt Text
D11696.diff (1 KB)
Attached To
Mode
D11696: Only let users log in to an OAuth server if they can see it
Attached
Detach File
Event Timeline
Log In to Comment