'query', 'prompt' => 'consent', // Scopes requested in authentication 'scope' => 'offline_access https://outlook.office.com/SMTP.Send https://graph.microsoft.com/Mail.ReadWrite' ]; /** * Constructor of the class. */ public function __construct() { $this->setServer("smtp.office365.com"); $this->setPort(587); } /** * Get $options property. * @return array */ public function getOptions() { return $this->options; } /** * Get a Microsoft object, this may vary depending on the service provider. * @return Google_Client */ public function getOffice365Client() { $provider = new Microsoft([ 'clientId' => $this->getClientID(), 'clientSecret' => $this->getClientSecret(), 'redirectUri' => $this->getRedirectURI(), 'urlAuthorize' => self::URL_AUTHORIZE, 'urlAccessToken' => self::URL_ACCESS_TOKEN, 'accessType' => 'offline' ]); $provider->defaultScopes = $this->options['scope']; return $provider; } }