Clicking the "save" button multiple times in the Saml IDP configuration page corrupts the value of "AuthnContext ClassRefs" · Issue #29314 · keycloak/keycloak · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clicking the "save" button multiple times in the Saml IDP configuration page corrupts the value of "AuthnContext ClassRefs" #29314
I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
admin/ui
Describe the bug
The problem occurs when I click the "save" button on the configuration page of a Saml IDP with a non-null value in the "AuthnContext ClassRefs" field
The first time I click save the value in the text box vanishes, although it's still persisted in the database and appears again if I refresh the page, however if I click save more than once the value becomes corrupted and it doesn't appear anymore in the "AuthnContext ClassRefs" field because I assume it can't be parsed properly. I will add the details below
Version
24.0.3
Regression
The issue is a regression
Expected behavior
When I click the "save" button of the Saml IDP config (or any custom IDP that extends saml by adding "-saml" to it's id) the value of the "AuthnContext ClassRefs" field should not disappear from the UI and it should stay the same regardless how many times I click save
Actual behavior
When I click the "save" button of the Saml IDP config (or any custom IDP that extends saml by adding "-saml" to it's id) the value of the "AuthnContext ClassRefs" field disappears from the UI, if I continue clicking the save button the value becomes corrupted
How to Reproduce?
Create a Saml idp, the configuration doesn't matter since it will not be used
Scroll down to the "AuthnContext ClassRefs" and input any value like "classRef"
Click the save button: the value will vanish from the UI but it's still persisted in the database
Click the save button multiple times and inspect the payload of the PUT request: you will see the corrupted values
click save 1: authnContextClassRefs: "["classRef"]"
click save 2: authnContextClassRefs: ""[\"classRef\"]""
click save 3: authnContextClassRefs: ""\"[\\\"classRef\\\"]\"""
etc
Also, if you type in a ClassRef without hitting Add AuthnContext ClassRef then it will not be saved. This is very confusing for the user as they expect what they typed in to be saved.
Activity
ssilvert commentedon May 6, 2024
I have verified this issue.
Also, if you type in a ClassRef without hitting
Add AuthnContext ClassRefthen it will not be saved. This is very confusing for the user as they expect what they typed in to be saved.Keep correct format of config fields
Keep correct format of config fields
Keep correct format of config fields
Keep correct format of config fields