tngan / samlify

Node.js library for SAML SSO
https://samlify.js.org
MIT License
610 stars 217 forks source link

how to change idp loginResponse tag prefix #388

Open fattydevelop opened 4 years ago

fattydevelop commented 4 years ago

Now use samlify my login repsponse format is

<samlp:Response 
    xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" 
    xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" 
    ID="_df4e082a-f4ad-4530-9e4c-a10e2750c108" 
    Version="2.0" 
    IssueInstant="2020-09-10T12:12:33.145Z" 
    Destination="xxx" 
    InResponseTo="undefined">
    <saml:Issuer>http://127.0.0.1:7001/saml/metadata</saml:Issuer>
    <samlp:Status>
        <samlp:StatusCode 
            Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
    </samlp:Status>
...

and i need to format it like below:

<saml2p:Response>
    <saml2:Issuer>...</saml2:Issuer>
    <saml2p:Status>
        ...
    </saml2p:Status>
    <saml2:Assertion>
        <saml2:Issuer>...</saml2:Issuer>
        <ds:Signature>
            ...
        </ds:Signature>
        <saml2:Subject>
            <saml2:NameID>${NameID}</saml2:NameID>
            <saml2:SubjectConfirmation>
                ...
            </saml2:SubjectConfirmation>
        </saml2:Subject>
        <saml2:Conditions>
            <saml2:AudienceRestriction>
                <saml2:Audience>${Audience}</saml2:Audience>
            </saml2:AudienceRestriction>
        </saml2:Conditions>
        <saml2:AuthnStatement>
            ...
        </saml2:AuthnStatement>
    </saml2:Assertion>
</saml2p:Response>

i do not know which api can do this.

vector-rc commented 2 years ago

Hello I have the same problem, did you find any way to solve it?

netmiller commented 7 months ago

Same problem in my application. I'm not sure if tag names are "must-to", meaning should it be compatible both ?