Skip to content

Commit

Permalink
Add a configuration to use custom URL validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
erozqba committed Dec 15, 2016
1 parent a24cfd1 commit 9af1b84
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Xavrsl/Cas/Sso.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ private function initializeCas()
$this->configureCasClient();

$this->configureSslValidation();
$this->configureServerValidateURL();
phpCAS::handleLogoutRequests();

$this->configureProxyChain();
Expand Down Expand Up @@ -99,6 +100,27 @@ private function configureSslValidation()
}
}

/**
* Configure Server Validate URL
*
* Override the validation URL is sometimes wanted.
*/
private function configureServerValidateURL()
{
// override validation URL for the CAS server
if ($this->config['cas_validation_url'])
{
if ($this->config['cas_saml'])
{
phpCAS::setServerSamlValidateURL($this->config['cas_validation_url']);
}
else
{
phpCAS::setServerServiceValidateURL($this->config['cas_validation_url']);
}
}
}

/**
* Configure Cas Proxy Chain
*
Expand Down
14 changes: 14 additions & 0 deletions src/config/cas.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@
'cas_validation' => env('CAS_VALIDATION', ''),


/*
|--------------------------------------------------------------------------
| Custom CAS Validation URL
|--------------------------------------------------------------------------
|
| Custom CAS server URL validation: In general the validation URL is in the same
| server and we don't need to provide this URL, but in some cases we can
| or need to provide a custom URL validation.
|
*/

'cas_validation_url' => env('CAS_VALIDATION_URL', false),


/*
|--------------------------------------------------------------------------
| CAS Certificate
Expand Down

0 comments on commit 9af1b84

Please sign in to comment.