silinternational / idp-pw-api-passwordstore-google
This package is abandoned and no longer maintained.
No replacement package was suggested.
Password store component for IdP PW API that uses Google as the backend.
1.0.0
2017-06-21 17:31 UTC
Requires
- php: >=7.0.0
- fillup/fake-bower-assets: ^2.0.9
- google/apiclient: ^2.0
- silinternational/idp-pw-api-common: ^1.0
- yiisoft/yii2: ~2.0.0
Requires (Dev)
- behat/behat: ^3.3
- phpunit/phpunit: ^6.0
- roave/security-advisories: dev-master
- silinternational/php-env: ^2.0
This package is auto-updated.
Last update: 2020-03-13 19:52:58 UTC
README
This repository is no longer maintained. It has been incorporated into idp-pw-api.
idp-pw-api-passwordstore-google
Password store component for IdP PW API that uses Google as the backend.
To Use
- Create a project on https://console.developers.google.com/.
- Still in the Google Developers Console, create a Service Account.
- Check "Furnish a new private key" and "Enable G Suite Domain-wide Delegation".
- Save the JSON file it provides (containing your private key), but DO NOT store it in public version control (such as in a public GitHub repo).
- Enable the "Admin SDK" API for your project in the Google Developers Console.
- Have an admin for the relevant Google Apps domain go to
http://admin.google.com/ and, under Security, Advanced, Manage API Client
Access, grant your Client ID access to the following scope:
https://www.googleapis.com/auth/admin.directory.user
- Set up a delegated admin account in Google Apps, authorized to make changes to users. You will use that email address as the value for an env. var.
- See the
local.env.dist
file to know what environment variables to provide when using this library.
Example Configuration
$googlePasswordStore = new GooglePasswordStore([
// Required config fields (dummy values are shown here):
'applicationName' => 'Name of Your Application',
'delegatedAdminEmail' => 'some_admin@yourgoogledomain.com',
// You must provide one of these two fields:
'jsonAuthConfigBase64' => '...', // A base64-encoded string of the JSON
// auth file provided by Google.
'jsonAuthFilePath' => '/somewhere/in/your/filesystem/google-auth.json',
// Optional config fields (current defaults are shown here):
'emailFieldName' => 'email',
'employeeIdFieldName' => 'employee_id',
'userActiveRecordClass' => '\common\models\User',
]);
For details about what each of those fields is used for, see the documenting
comments in the /src/Google.php
file.