Merge branch 'sch_sso' into 'develop'

added redirect field in casost config entity

See merge request !54
parents 47574dda 2ab0478f
...@@ -21,6 +21,7 @@ class CASLogin extends ControllerBase ...@@ -21,6 +21,7 @@ class CASLogin extends ControllerBase
protected $serverHostname; protected $serverHostname;
protected $serverPort; protected $serverPort;
protected $serverUri; protected $serverUri;
protected $redirectUrl;
protected $changeSessionId; protected $changeSessionId;
protected $CASServerCACert; protected $CASServerCACert;
protected $CASServerCNValidate; protected $CASServerCNValidate;
...@@ -75,6 +76,7 @@ class CASLogin extends ControllerBase ...@@ -75,6 +76,7 @@ class CASLogin extends ControllerBase
$this->serverHostname = $CASOSTConfig->serverhostname->value; $this->serverHostname = $CASOSTConfig->serverhostname->value;
$this->serverPort = $CASOSTConfig->serverport->value; $this->serverPort = $CASOSTConfig->serverport->value;
$this->serverUri = $CASOSTConfig->serveruri->value === null ? '' : $CASOSTConfig->serveruri->value; $this->serverUri = $CASOSTConfig->serveruri->value === null ? '' : $CASOSTConfig->serveruri->value;
$this->redirectUrl = $CASOSTConfig->redirecturl->value;
$this->changeSessionId = $CASOSTConfig->changesessionid->value; $this->changeSessionId = $CASOSTConfig->changesessionid->value;
$this->CASServerCACert = $CASOSTConfig->casservercacert->value; $this->CASServerCACert = $CASOSTConfig->casservercacert->value;
$this->CASServerCNValidate = $CASOSTConfig->casservercnvalidate->value; $this->CASServerCNValidate = $CASOSTConfig->casservercnvalidate->value;
...@@ -175,8 +177,7 @@ class CASLogin extends ControllerBase ...@@ -175,8 +177,7 @@ class CASLogin extends ControllerBase
// $this->logger->warning('cn=' . $filterAttribute('cn')); // $this->logger->warning('cn=' . $filterAttribute('cn'));
$epalToken = $this->authenticatePhase2($request, $CASUser, $filterAttribute('cn')); $epalToken = $this->authenticatePhase2($request, $CASUser, $filterAttribute('cn'));
if ($epalToken) { if ($epalToken) {
return new RedirectResponse($this->redirectUrl . '?auth_token=' . $epalToken.'&auth_role=director', 302, []);
return new RedirectResponse('/dist/#/school?auth_token=' . $epalToken.'&auth_role=director', 302, []);
} else { } else {
$response = new Response(); $response = new Response();
$response->setContent('forbidden'); $response->setContent('forbidden');
......
...@@ -290,6 +290,26 @@ class CASOSTConfig extends ContentEntityBase implements CASOSTConfigInterface ...@@ -290,6 +290,26 @@ class CASOSTConfig extends ContentEntityBase implements CASOSTConfigInterface
->setDisplayConfigurable('form', true) ->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true); ->setDisplayConfigurable('view', true);
$fields['redirecturl'] = BaseFieldDefinition::create('string')
->setLabel(t('Redirect Url'))
->setDescription(t('Redirect Url'))
->setSettings(array(
'max_length' => 200,
'text_processing' => 0,
))
->setDefaultValue('/dist/#/school')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
$fields['changesessionid'] = BaseFieldDefinition::create('boolean') $fields['changesessionid'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Change Session Id')) ->setLabel(t('Change Session Id'))
->setDescription(t('A boolean indicating whether we change session id.')) ->setDescription(t('A boolean indicating whether we change session id.'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment