/** * Returns logout button * * @param boolean $redirect * * @return \Twig_Markup */ public function displayLogout($redirect) { $target = ''; // empty target if ($redirect) { $target = '?redirect=' . urlencode($this->app['resources']->getUrl('current')); } $context = ['providers' => ['logout' => ['link' => $this->app['resources']->getUrl('root') . $this->config->getUriBase() . '/logout' . $target, 'label' => $this->config->getLabel('logout') ?: 'Logout', 'class' => 'logout']]]; $html = $this->app['render']->render($this->config->getTemplate('button'), $context); return new \Twig_Markup($html, 'UTF-8'); }
/** * Construct the authorisation URL with query parameters. * * @param string $providerName * * @return string */ protected function getCallbackUrl($providerName) { $key = $this->config->get('response_noun'); $url = $this->rootUrl . $this->config->getUriBase() . "/oauth2/callback?{$key}={$providerName}"; $this->logger->debug("[ClientLogin][Provider]: Setting callback URL: {$url}"); return $url; }