kingstarter / laravel-saml

A laravel 5.4 / 5.5 SAML plugin that transforms laravel into an IDP.
MIT License
55 stars 29 forks source link

Add additional Claim Types to the Assertion #21

Open upwebdesign opened 5 years ago

upwebdesign commented 5 years ago

The current claim types supported are:

ClaimTypes::EMAIL_ADDRESS ClaimTypes::COMMON_NAME ClaimTypes::ROLE

When integrating to a Service Provider like LinkedIn Learning, they use these in addition to the above:

ClaimTypes::GIVEN_NAME ClaimTypes::SURNAME

Currently I do not see a way to add additional Claim Types in the SamlAuth.php trait. I could override the buildSamlResponse method, but it is a monstrous method already.

The idea here is to allow for chaining of this code to add any Claim Type we want: https://github.com/kingstarter/laravel-saml/blob/4b656b817a7bb4e784b07dff20695c9c6118a0dc/src/Http/Traits/SamlAuth.php#L201-L215

Thoughts?