simplesamlphp / simplesamlphp/simplesamlphp
Retrieve SAML assertion from SAML Response
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.1k
- Forks
- 704
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 4
Description
Hi all,
considering the following scenario
- IdP platform that expose authentication service via SAML 2.0
- Backend Service platform that expose APIs via Oauth2
- Web Application that play the role of Service Provider, that uses IdP service for user authentication and Backend Service Platform APIs for implementing business logic
In this scenario, IdP and Backend Service Platform are trusted and OAuth2 token is generated using SAMLBearer grant type by passing also the assertion included in the response.
The E2E flow works in this way
- user hits a Web App URL
- user is redirected to IdP (SP initiated flow)
- user is authenticated on IdP and redirected to Web Application
- web application retrieves SAML assertion from the SAML response
- web application requests an OAuth2 token by using SAMLBearer as grant type and the assertion as value
- Backend Service Platform checks the SAML Response (signature, encryption etc...) and generates the token
- web application starts consuming APIs
We were able to succesfully implement the first three steps using simpleSAMLphp v1.13
However, there are no APIs available to get the assertion from the response for step 4 (the getAttributes can only be used to retrieve claims..)
In order to implement the E2E flow, we had to add a method in the following file to retrieve the assertion
• simplesamlphp\vendor\simplesamlphp\saml2\src\SAML2\HTTPPost.php
The assertion is then retireved in
• simplesamlphp\modulerà\saml\www\sp\saml2-acs.php
With this change we were able to complete the flow
I think it make sense to have this as an enhancement, so that the same scenario can be supported out of the box.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing simplesamlphp/vendor/simplesamlphp/saml2/src/SAML2/HTTPPost.php and the assertion retrieval in simplesamlphp/modulerà/saml/www/sp/saml2-acs.php. Compare this with the existing getAttributes behavior and confirm that the assertion can be exposed for the SAML bearer flow without changing the existing authentication steps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100