Hi Udara, Adding script programmatically negates the very reason we introduce scripts. Script has to be external to the code inside DB or file.
What is the testing you are trying to achieve here ? If you looking at Integration tests, please refer [1] [1] https://github.com/wso2/product-is/blob/b210a95ba9c289b98c812d9ad493a4d5f279e594/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/auth/ConditionalAuthenticationTestCase.java Cheers, Ruwan On Sun, May 20, 2018 at 10:03 AM, Udara Rathnayake <[email protected]> wrote: > Hi, > > In a typical IS as a KM setup, We have a KM extension written to attach > 2steps(1st- basic, 2nd- smsotp) authentication during application creation > time. With IS 5.6.0-M6 we need to add a conditional authentication script > to the same KM extension. > > I was able to do this with the following, > > LocalAndOutboundAuthenticationConfig localAndOutboundAuthenticationConfig >> = new LocalAndOutboundAuthenticationConfig(); >> AuthenticationScriptConfig scriptConfig = new >> AuthenticationScriptConfig(); >> scriptConfig.setContent(<JavaScript goes here>); >> scriptConfig.setEnabled(true); >> localAndOutboundAuthenticationConfig.setAuthenticationScriptConfig( >> scriptConfig); >> > > For the testing purpose I have added the JavaScript code within the > same. What is the recommended approach to keep the conditional > authentication script in a similar situation? > > Reading from a config file outside km extension or keeping inside the same > Java code? > > Until we finalize the conditional authentication script there is an > advantage in the following approach as we don't need to build the source > again and again for testing. > > Thanks! > > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- *Ruwan Abeykoon* *Associate Director/Architect**,* *WSO2, Inc. http://wso2.com <https://wso2.com/signature> * *lean.enterprise.middleware.*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
