Skip to content

Commit

Permalink
Rename nameIdPolicy parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
pitbulk committed May 10, 2016
1 parent 874950f commit cbbcab7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ The login method can recieve other five optional parameters:
* `$forceAuthn` - When true the `AuthNRequest` will set the `ForceAuthn='true'`
* `$isPassive` - When true the `AuthNRequest` will set the `Ispassive='true'`
* `$strict` - True if we want to stay (returns the url string) False to redirect
* `$nameIdPolicy` - When true the AuthNReuqest will set a nameIdPolicy element.
* `$setNameIdPolicy` - When true the AuthNReuqest will set a nameIdPolicy element.

If a match on the future SAMLResponse ID and the AuthNRequest ID to be sent is required, that AuthNRequest ID must to be extracted and saved.

Expand Down
16 changes: 8 additions & 8 deletions lib/Saml2/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,20 +323,20 @@ public function getAttribute($name)
/**
* Initiates the SSO process.
*
* @param string|null $returnTo The target URL the user should be returned to after login.
* @param array $parameters Extra parameters to be added to the GET
* @param bool $forceAuthn When true the AuthNReuqest will set the ForceAuthn='true'
* @param bool $isPassive When true the AuthNReuqest will set the Ispassive='true'
* @param bool $stay True if we want to stay (returns the url string) False to redirect
* @param bool $nameIdPolicy When true the AuthNReuqest will set a nameIdPolicy element
* @param string|null $returnTo The target URL the user should be returned to after login.
* @param array $parameters Extra parameters to be added to the GET
* @param bool $forceAuthn When true the AuthNReuqest will set the ForceAuthn='true'
* @param bool $isPassive When true the AuthNReuqest will set the Ispassive='true'
* @param bool $stay True if we want to stay (returns the url string) False to redirect
* @param bool $setNameIdPolicy When true the AuthNReuqest will set a nameIdPolicy element
*
* @return If $stay is True, it return a string with the SLO URL + LogoutRequest + parameters
*/
public function login($returnTo = null, $parameters = array(), $forceAuthn = false, $isPassive = false, $stay=false, $nameIdPolicy = true)
public function login($returnTo = null, $parameters = array(), $forceAuthn = false, $isPassive = false, $stay=false, $setNameIdPolicy = true)
{
assert('is_array($parameters)');

$authnRequest = new OneLogin_Saml2_AuthnRequest($this->_settings, $forceAuthn, $isPassive, $nameIdPolicy);
$authnRequest = new OneLogin_Saml2_AuthnRequest($this->_settings, $forceAuthn, $isPassive, $setNameIdPolicy);

$this->_lastRequestID = $authnRequest->getId();

Expand Down
10 changes: 5 additions & 5 deletions lib/Saml2/AuthnRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class OneLogin_Saml2_AuthnRequest
* Constructs the AuthnRequest object.
*
* @param OneLogin_Saml2_Settings $settings Settings
* @param bool $forceAuthn When true the AuthNReuqest will set the ForceAuthn='true'
* @param bool $isPassive When true the AuthNReuqest will set the Ispassive='true'
* @param bool $nameIdPolicy When true the AuthNReuqest will set a nameIdPolicy
* @param bool $forceAuthn When true the AuthNReuqest will set the ForceAuthn='true'
* @param bool $isPassive When true the AuthNReuqest will set the Ispassive='true'
* @param bool $setNameIdPolicy When true the AuthNReuqest will set a nameIdPolicy
*/
public function __construct(OneLogin_Saml2_Settings $settings, $forceAuthn = false, $isPassive = false, $nameIdPolicy = true)
public function __construct(OneLogin_Saml2_Settings $settings, $forceAuthn = false, $isPassive = false, $setNameIdPolicy = true)
{
$this->_settings = $settings;

Expand All @@ -45,7 +45,7 @@ public function __construct(OneLogin_Saml2_Settings $settings, $forceAuthn = fal
$issueInstant = OneLogin_Saml2_Utils::parseTime2SAML(time());

$nameIdPolicyStr = '';
if ($nameIdPolicy) {
if ($setNameIdPolicy) {
$nameIDPolicyFormat = $spData['NameIDFormat'];
if (isset($security['wantNameIdEncrypted']) && $security['wantNameIdEncrypted']) {
$nameIDPolicyFormat = OneLogin_Saml2_Constants::NAMEID_ENCRYPTED;
Expand Down

0 comments on commit cbbcab7

Please sign in to comment.