*/ class action_plugin_oauthdrkserver extends Adapter { /** @inheritdoc */ public function registerServiceClass() { $useDemoEnv = $this->getConf('demoenv'); DRKServer::setUseDemoEnvironment($useDemoEnv); return DRKServer::class; } /** * @inheritDoc */ public function getUser() { $oauth = $this->getOAuthService(); $data = array(); $result = json_decode($oauth->request(DRKServer::getUserInfoEndpoint()), true); $data['user'] = $result[DRKServer::USERINFO_JSON_USER]; $data['name'] = $result[DRKServer::USERINFO_JSON_NAME]; $data['mail'] = $result[DRKServer::USERINFO_JSON_MAIL]; $data['grps'] = $result[DRKServer::USERINFO_JSON_GRPS]; return $data; } /** @inheritdoc */ public function getScopes() { $scopes = [DRKServer::SCOPE_OPENID, DRKServer::SCOPE_EMAIL, DRKServer::SCOPE_PROFILE]; return $scopes; } /** @inheritDoc */ public function getLabel() { return DRKServer::BUTTON_LABEL; } /** @inheritDoc */ public function getColor() { return DRKServer::BUTTON_BACKGROUND_COLOR; } }