lightSAML / SpBundle

SAML2 SP Symfony Bundle based on LightSAML
https://www.lightsaml.com/SP-Bundle/
MIT License
66 stars 70 forks source link

Adding RequestedAuthnContext to the AuthnRequest #72

Open salahm opened 6 years ago

salahm commented 6 years ago

Hi !

I struggling in adding an RequestedAuthnContext node to an AuthnRequest xml request

expected result

<?xml version="1.0" encoding="UTF-8"?>
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="ONELOGIN_3032e287176d383ac6efa999f8e58775222efff3" Version="2.0" IssueInstant="2018-05-24T15:12:48Z" Destination="https://example.comsaml2sso" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="http://example.com/?acs">
   <saml:Issuer>example.com</saml:Issuer>
   <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" AllowCreate="true" />
   <samlp:RequestedAuthnContext Comparison="Minimum">
      <saml:AuthnContextClassRef>urn:example:saml:auth-level:1.0:low</saml:AuthnContextClassRef>
   </samlp:RequestedAuthnContext>
</samlp:AuthnRequest>

is there a proper way to achieve this ?

I can't find any way to handle it without creating a new LightSaml\Model\Protocol\SamlMessage, overriding the whole workflow which creates LightSaml\Model\Protocol\AuthnRequest and add my freshly created node.

Thanks in advance

PS : Sorry if the issue is not in the right repository.

ahmad-shawky commented 5 years ago

@salahm Did you solved this ?

ahmad-shawky commented 5 years ago

Any update regarding this issue ?