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

Prompt adaptive script function not properly working with remove_on_consume_from_api="true" config #16622

Closed
dewniMW opened this issue Sep 11, 2023 · 1 comment

Comments

@dewniMW
Copy link
Contributor

dewniMW commented Sep 11, 2023

Configure an adaptive script with the prompt function and try the authentication flow.

var onLoginRequest = function(context) {
   executeStep(1, {
       onSuccess: function (context) {
           var username = context.steps[1].subject.username;
           prompt("genericForm", {"username":username, "inputs":[{"id":"fname","label":"First Name"},{"id":"lname","label":"Last Name"}]}, {
             onSuccess : function(context) {
                var fname = context.request.params.fname[0];
                var lname = context.request.params.lname[0];
                Log.info(fname);
                Log.info(lname);
             }
           });
       }
   });
}

The prompt function will work as shown below.

Screen Shot 2023-09-11 at 7 38 45 PM

Now add the following config (https://is.docs.wso2.com/en/latest/apis/use-the-authentication-rest-apis/) in the deployment.toml and retry the authentication flow after a server restart.

[authentication.endpoint.redirect_params]
filter_policy = "exclude"
remove_on_consume_from_api = "true"
parameters = ["ske"]

The input fields are missing in the UI as shown below.

Screen Shot 2023-09-11 at 7 33 29 PM

If we remove remove_on_consume_from_api = "true" from the config and try the flow, then it works correctly. As per the analysis https://github.com/wso2/identity-apps/blob/master/identity-apps-core/apps/authentication-portal/src/main/webapp/dynamic_prompt.jsp#L55 becomes null when remove_on_consume_from_api = "true"

Environment information:

  • Product Version: wso2is-7.0.0-m2-SNAPSHOT
  • OS: Mac
@ashanthamara
Copy link
Contributor

Closing the issue since the fix is deployed in the product-is (4976)

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

No branches or pull requests

9 participants