Skip to content

Commit

Permalink
Merge pull request #106 from dpoulson/master
Browse files Browse the repository at this point in the history
Allow default COMMON_NAME field to be configurable
  • Loading branch information
upwebdesign authored Dec 1, 2022
2 parents c0dcc98 + 2521228 commit ba23dd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/samlidp.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
'debug' => false,
// Define the email address field name in the users table
'email_field' => 'email',
// Define the name field in the users table
'name_field' => 'name',
// The URI to your login page
'login_uri' => 'login',
// Log out of the IdP after SLO
Expand Down
2 changes: 1 addition & 1 deletion src/Events/Assertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public function __construct(\LightSaml\Model\Assertion\AttributeStatement &$attr
$this->attribute_statement = &$attribute_statement;
$this->attribute_statement
->addAttribute(new Attribute(ClaimTypes::EMAIL_ADDRESS, auth($guard)->user()->__get(config('samlidp.email_field', 'email'))))
->addAttribute(new Attribute(ClaimTypes::COMMON_NAME, auth($guard)->user()->name));
->addAttribute(new Attribute(ClaimTypes::COMMON_NAME, auth($guard)->user()->__get(config('samlidp.name_field', 'name'))));
}
}

0 comments on commit ba23dd7

Please sign in to comment.