A kickstarter for the Google Identity Toolkit
Some boilerplate files to help to create a quick login access to your application with the Google Identity Toolkit
├── callback.php
├── identity
│ ├── callback-server-config.json
│ └── composer.json
├── index.php
└── login.php
File | Description |
---|---|
index.php | Entry point where we checked if the user is logged. If not, redirection to /login |
login.php | Page with the signin button |
callback.php | the page to return to when authentication is complete |
git clone https://github.com/92bondstreet/google-identity.git
cd google-identity/identity
curl -s https://getcomposer.org/installer | php
php composer.phar install
var config = {
// Copy and paste client configuration here
};
Once configuration done in Google Developers Console, there are two code snippets at the bottom of the page.
The second snippet should be saved in identity/callback-server-config.json
file.
chmod 755 /absolute/path/to/p12/file
On the login page, I hide the navbar
button:
<div id="navbar" style="display:none"></div>
to use a custom button instead and dispatch the click event:
document.querySelector('button.gitkit-button.gitkit-id-submit').dispatchEvent(event);