Files
iTop/lib/league/oauth2-google/examples/provider.php
Eric Espie 134736dce5 N°3169 - Add feature to connect Gsuite mail box with OAuth
N°2504 - Add feature to connect Office mail box with OAuth2 for Microsoft Graph
N°5102 - Allow to send emails (eg. notifications) using GSuite SMTP and OAuth
 * 2.7 migration (wip)
2022-05-13 11:37:09 +02:00

25 lines
625 B
PHP

<?php
require __DIR__ . '/../vendor/autoload.php';
use League\OAuth2\Client\Provider\Google;
// Replace these with your token settings
// Create a project at https://console.developers.google.com/
$clientId = 'your-client-id';
$clientSecret = 'your-client-secret';
// Change this if you are not using the built-in PHP server
$redirectUri = 'http://localhost:8080/';
// Start the session
session_start();
// Initialize the provider
$provider = new Google(compact('clientId', 'clientSecret', 'redirectUri'));
// No HTML for demo, prevents any attempt at XSS
header('Content-Type', 'text/plain');
return $provider;