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

AllowCreate not being properly filled in SAMLRequest #544

Closed
SDepn opened this issue Jul 10, 2024 · 1 comment
Closed

AllowCreate not being properly filled in SAMLRequest #544

SDepn opened this issue Jul 10, 2024 · 1 comment

Comments

@SDepn
Copy link

SDepn commented Jul 10, 2024

I noticed that since version 2.8.11, the AllowCreate attribute in the NameIDPolicy node in the SAMLRequest was not filled. When allowCreate on the ServiceProvider initialization is either not set (default value) or manually set to false, the field is empty. When it is set to true it throws an string.replace is not a function error.

Digging deeper, I found out that 14055ff introduced a new bug where escapeTag (https://github.com/tngan/samlify/blob/master/src/libsaml.ts#L242) always expects a string for the text variable, while AllowCreate is a boolean.

This results in text || '' (https://github.com/tngan/samlify/blob/master/src/libsaml.ts#L245) either resolving to '' for false, or to true for true.

Setting the allowCreate variable to "true" or "false" in the ServiceProvider initialization and ignoring the type definitions results in the attribute being properly filled.

The easiest fix for this would probably be to just call toString() on the t in https://github.com/tngan/samlify/blob/master/src/libsaml.ts#L270, but I am not sure if this causes other issues.

@SDepn
Copy link
Author

SDepn commented Jul 11, 2024

Just found out that it's a duplice of #538. Closing this one.

@SDepn SDepn closed this as completed Jul 11, 2024
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

1 participant