discovery)) { $plugin = plugin_load('action', 'oauthazure'); $discover = 'https://login.microsoftonline.com/%s/v2.0/.well-known/openid-configuration'; $discover = sprintf($discover, $plugin->getConf('tenant')); $http = new DokuHTTPClient(); $json = $http->get($discover); if (!$json) return ''; $this->discovery = json_decode($json, true); } if (!isset($this->discovery[$endpoint])) return ''; return $this->discovery[$endpoint]; } /** @inheritdoc */ public function getAuthorizationEndpoint() { return new Uri($this->getEndpoint(self::ENDPOINT_AUTH)); } /** @inheritdoc */ public function getAccessTokenEndpoint() { $uri = new Uri($this->getEndpoint(self::ENDPOINT_TOKEN)); //$uri->addToQuery('requested_token_use', 'on_behalf_of'); return $uri; } /** @inheritdoc */ protected function getAuthorizationMethod() { return static::AUTHORIZATION_METHOD_HEADER_BEARER; } /** * Logout from Azure * * @return void * @throws \OAuth\Common\Exception\Exception */ public function logout() { send_redirect($this->getEndpoint(self::ENDPOINT_LOGOUT)); } }