Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Extensions in AuthnRequest #382

Open
tyctor opened this issue Jun 28, 2023 · 2 comments
Open

Include Extensions in AuthnRequest #382

tyctor opened this issue Jun 28, 2023 · 2 comments

Comments

@tyctor
Copy link

tyctor commented Jun 28, 2023

hi

i cannot find documentation/example how to include <samlp:Extensions> in <samlp:AuthnRequest>
is it possible to do it?
could you please point me to some example?

@peppelinux
Copy link
Member

We don't have support for this but I can show you how you can contribute to this project and have another release with your desidered feature

here https://github.com/IdentityPython/djangosaml2/blob/master/djangosaml2/views.py#L331C58-L331C58
we should add the extentions optional attribute or, better, add in the sso_args dictionary the key extensions with your desidered ones

this will pass the desidered extentions here: https://github.com/IdentityPython/pysaml2/blob/a9fe345ba1bb4ef516673b1acbd01db80ccdf658/src/saml2/client.py#L39

@tyctor
Copy link
Author

tyctor commented Jul 19, 2023

i found, that this can be put into sp settings as list of dicts in key requested_attributes, for example:

"requested_attributes": [
    {
        "name": "http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier",
        "name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:uri",
        "required": "true",
    },
]

will create:

<samlp:Extensions>
  <ns3:RequestedAttributes>
    <ns3:RequestedAttribute Name="http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/>
  </ns3:RequestedAttributes>
</samlp:Extensions>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants