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

EncryptedAttributes are not supported #426

Open
HichamDz38 opened this issue Mar 5, 2025 · 5 comments
Open

EncryptedAttributes are not supported #426

HichamDz38 opened this issue Mar 5, 2025 · 5 comments

Comments

@HichamDz38
Copy link

i am communication with an IDP that has a policy to encrypt the attributes,
they cannot change the policy and i have to deal with encrypted Attributes,
what is the solution to parse Encrypted Attributes, and why it's not supported by the SAML-Toolkits?

@pitbulk
Copy link
Contributor

pitbulk commented Mar 6, 2025

HI @HichamDz38,

the toolkit supports encrypted attributes.

In order to be able to receive encrypted attributes, you need to:

  1. Set SP private key (privateKey) and public cert (x509cert), and at the security settings, mark
    "wantAssertionsEncrypted": true,
  2. After that, SP Metadata XML will contain info for the IdP exposing the public cert as the one to use during the encrypt process at the IdP.

When your integration receive the SAMLResponse with EncryptedAttribute, will be able to decrypt it with the SP private key, you don't need to do something special, the attributes gonna be available using the method get_attributes()

@HichamDz38
Copy link
Author

HichamDz38 commented Mar 6, 2025

HI @pitbulk, thank you for your response
well as i said the Attributes are encrypted not the whole assertion,
i said Encrypted Attributes are not supported, because that what is written in the get_attributes method,
my question is about why that isn't supported, it's for future enhancement or what?
greetings

@pitbulk
Copy link
Contributor

pitbulk commented Mar 6, 2025

The saml2int spec indicates the following:

XML Encryption
[SDP-SP10]
SPs MUST support decryption of saml:EncryptedAssertion elements. Support for other encrypted constructs is OPTIONAL.

https://kantarainitiative.github.io/SAMLprofiles/saml2int.html

What IdP are you using that Encrypt Attributes but is not able to encrypt the Assertion?

@HichamDz38
Copy link
Author

ADFS

@pitbulk
Copy link
Contributor

pitbulk commented Mar 6, 2025

I believe ADFS supports EncryptedAssertions

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

No branches or pull requests

2 participants