Hi Ruwan,

Thank you for the input.

On Sun, May 20, 2018 at 1:43 PM, Ruwan Abeykoon <ruw...@wso2.com> wrote:

> Hi Udara,
> Adding script programmatically negates the very reason we introduce
> scripts. Script has to be external to the code inside DB or file.
>
+1

>
> What is the testing you are trying to achieve here ? If you looking at
> Integration tests, please refer [1]
>
​Our script is not yet finalized, so we need to modify this going forward.
(word testing is a bit misleading sorry about that :) )


> [1] https://github.com/wso2/product-is/blob/b210a95ba9c289b98c812d9ad493a4
> d5f279e594/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 <uda...@wso2.com>
> 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.setAuthenticationScript
>>> Config(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
>> Dev@wso2.org
>> 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.*
>
>


-- 
Regards,
UdaraR <http://bit.ly/udarakr>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to