Esempio n. 1
0
 /**
  * this method is called through King23s routing,
  * it is supposed to offer a list of OAuth2 Providers
  * which the user can use to authenticate himself
  * @param array $params
  * returns string
  */
 public function login(array $params)
 {
     $reg = \King23\Core\Registry::getInstance();
     $state = \Kingboard\Lib\Form::getXSRFToken();
     $list = array();
     foreach ($reg->oAuth2ProviderList as $provider => $config) {
         $class = $config['auth_class'];
         $list[$provider] = \Kingboard\Lib\Auth\OAuth2\Consumer::getCodeRedirect($class::getCodeUrl(), $config["client_id"], $config["redirect_url"], $state, $class::getScope());
     }
     return $this->render("user/oauth.html", array("providerlist" => $list));
 }