Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a warning for 3 legged OAuth credentials #199

Merged
merged 2 commits into from
Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/bootstrap.php" colors="true">
<phpunit bootstrap="tests/bootstrap.php" colors="true"
convertWarningsToExceptions="false">
<testsuites>
<testsuite name="google-auth-tests">
<directory suffix="Test.php">tests</directory>
Expand Down
10 changes: 10 additions & 0 deletions src/Credentials/UserRefreshCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ public function __construct(
'scope' => $scope,
'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI,
]);
trigger_error(
'Your application has authenticated using end user credentials '
. 'from Gooogle Cloud SDK. We recommend that most server '
. 'applications use service accounts instead. If your application '
. 'continues to use end user credentials from Cloud SDK, you might '
. 'receive a "quota exceeded" or "API not enabled" error. For '
. 'more information about service accounts, see '
. 'https://cloud.google.com/docs/authentication/.',
E_USER_WARNING
);
}

/**
Expand Down