[Dev] Issue in File connector when dump the entire payload

2018-10-11 Thread Shazni Nazeer
Hi,

I have the below which I was trying to place the entire body in the remote
site and it's failing. I suppose this same syntax has worked for me in the
past with an older version of file-connector with older versions of ESB

sftp://
username:passw...@ftp.support.wso2.com:22/sometest/demo/unavailable_service.txt

{$body}


When I change the {$body} to plain text, it seems to be working.

Any idea?

-- 
Shazni Nazeer

Mob : +94 37331
LinkedIn : http://lk.linkedin.com/in/shazninazeer

Blogs :

https://medium.com/@mshazninazeer
http://shazninazeer.blogspot.com


___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to transfer API manager to a new system

2018-10-11 Thread Rukshan Premathunga
Hi Bernard,



On Thu, Oct 11, 2018 at 8:44 PM Bernard Paris 
wrote:

> Hello,
>
> we have an API manager running 2.1.0 version ; we want to replace this
> server and install a brandnew API manager with a 2 nodes cluster
> (active/active) running  2.5.0 (new servers and new DBs).
> The question is how shall we proceed to transfer datas (APIs definition,
> applications, users, grants …) from our current system to the new one ?
>
> Are we to copy current databases (all are postgres DB except metrics DB
> which is H2 type) to new DB and synapse-configs to new servers, run 2.1.0
> version on new system,  then apply the upgrade process as described at
> https://docs.wso2.com/display/AM250/Upgrading+from+the+Previous+Release ?
>
Yes. Best option is to migrate to latest version because all import/export
tool will not support all the artifact in your current system.

>
> (by the way, online upgrade info to latest 2.6.0 should be fine)
>
> Thanks for your help
> Bernard Paris
>
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.
+94711822074
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] How to transfer API manager to a new system

2018-10-11 Thread Bernard Paris
Hello,

we have an API manager running 2.1.0 version ; we want to replace this server 
and install a brandnew API manager with a 2 nodes cluster (active/active) 
running  2.5.0 (new servers and new DBs).
The question is how shall we proceed to transfer datas (APIs definition, 
applications, users, grants …) from our current system to the new one ?  

Are we to copy current databases (all are postgres DB except metrics DB which 
is H2 type) to new DB and synapse-configs to new servers, run 2.1.0 version on 
new system,  then apply the upgrade process as described at 
https://docs.wso2.com/display/AM250/Upgrading+from+the+Previous+Release ?

(by the way, online upgrade info to latest 2.6.0 should be fine)

Thanks for your help
Bernard Paris




___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IAM] InCommon Federation Compliance for WSO2IS - eduPerson Claim Dialect

2018-10-11 Thread Sahan Gunathilaka
Hi All,

I have discussed the above matter with some team members and came up with a
solution. Therefore, I am going to make a change that will let to add
properties for claims in *external dialects* too. To do that, I will change
the "*LOCAL_CLAIM_ID*" column name in "*IDN_CLAIM_PROPERTY*" table (which
is a foreign key references "*ID*" in "*IDN_CLAIM*") into "*CLAIM_ID*".
(IDN_CLAIM table contains all local and external claims)
Then, I will improve the source code accordingly to address the change.

Thanks
Best Regards!

On Thu, Oct 11, 2018 at 12:01 PM Sahan Gunathilaka  wrote:

> Hi All,
>
> According to a requirement of InCommon Federation, each SAML entity should
> support eduPerson attribute schema to exchange claims. Since there is not a
> claim dialect in WSO2IS to support that schema, I previously mailed
> mentioning about creating a new claim dialect for that.
>
> As a further extension, there is an addition property as "*FriendlyName*"
> for each claim. But, only the wso2 local claim dialect (
> http://wso2.org/claims) supports to add additional property for each
> claim. There is no way to add additional properties for claims in external
> claim dialects. What I think is that there can be additional properties for
> claims in specific external dialects too. Therefore, there should be a way
> to add them for claims in external dialects as well.
>
> I am looking forward for answers regarding this matter.
>
> Thanks
> Best Regards!
>
>
> --
> *Sahan Gunathilaka*
> Intern - Software Engineering
> *WSO2*
> mobile:  +94776343266
>
> [image: http://wso2.com/signature]
>


-- 
*Sahan Gunathilaka*
Intern - Software Engineering
*WSO2*
mobile:  +94776343266

[image: http://wso2.com/signature]
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IAM] Loading Function Libraries to Authentication Scripts

2018-10-11 Thread Ruwan Abeykoon
Hi Anuradha,
I think require() [1] function better suited for this.
Reason is that many other dynamic language based on JS uses it and seems
intuitive.

[1]
https://stackoverflow.com/questions/9901082/what-is-this-javascript-require

Cheers,
Ruwan
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS 560] Adaptive authentication - How to handle retry scenarios

2018-10-11 Thread Hasitha De Silva
I believe this is specific to the federated authenticator use within
conditional auth retry flow.

Best regards,

On Thu, Oct 11, 2018 at 1:58 PM Hasitha De Silva 
wrote:

> I did try this with 5.7.0 as well .. however the NPE was still there.
>
> Best Regards,
>
> On Thu, Oct 11, 2018 at 1:54 PM Ruwan Abeykoon  wrote:
>
>> Hi Hasitha,
>> Will you able to try this on IS 5.7.0 ?
>> Adaptive authentication was in dev state as at IS 5.6.0.
>> Cheers,
>> Ruwan
>>
>> On Thu, Oct 11, 2018 at 5:01 PM Hasitha De Silva 
>> wrote:
>>
>>> Thanks a lot Hasintha.
>>>
>>> I tried with the above approach and still got an NPE. Created a PR with
>>> a possible fix.
>>>
>>> https://github.com/wso2-extensions/identity-extension-utils/pull/13
>>>
>>> Do let me know if there is a better approach that works out of the box.
>>>
>>> Best Regards,
>>>
>>> On Thu, Oct 11, 2018 at 12:29 PM Hasintha Indrajee 
>>> wrote:
>>>
 I am using the below script to re-attempt on failures from step1;


 var rolesToStepUp = ['admin', 'Manager'];

 var errorPageParameters = {

'status': 'Unauthorized',

'statusMsg': 'You are not authorized to access this application'

 };

 var errorPage = '';

 function onLoginRequest(context) {

   executeBasicAuth(context);

 }

 function executeBasicAuth(context) {

   executeStep(1,{

   onSuccess: function (context) {

  // Extracting authenticated subject from the first step

var user = context.currentKnownSubject;

// Checking if the user is assigned to one of the given roles

var hasRole = hasAnyOfTheRoles(user, rolesToStepUp);

if (hasRole) {

Log.info(user.username + ' Has one of Roles: ' +
 rolesToStepUp.toString());

executeStep(2);

} else {

  sendError(errorPage, errorPageParameters);

 }

   },

   onFail: function (context) {

 executeBasicAuth(context);

   }



   });

 }


 On Thu, Oct 11, 2018 at 2:10 PM Hasitha De Silva 
 wrote:

> [+ maduranga]
>
> On Wed, Oct 10, 2018 at 3:46 PM Hasitha De Silva 
> wrote:
>
>> Hi,
>>
>> I'm having some trouble trying to simulate the login failure
>> scenarios with conditional auth scripts. What is the ideal way to enforce
>> the script to retry login attempts ?
>>
>> Right now my script is as below;
>>
>> function onLoginRequest(context) {
>> executeStep(1, {
>> onSuccess: function(context) {
>> if (!checkIP(context)) {
>> if (!checkIPInSubnet(context)) {
>> if (step2CheckEmail(context)) {
>> executeStep(2, {
>> onFail: function(context) {
>> executeStep(2);
>> }
>> });
>> }
>> }
>> }
>> },
>> onFail: function(context) {
>> executeStep(1);
>> }
>> });
>> }
>>
>> The expected flow is that the user is taken to the email otp page
>> after basic login, and then, if he/she enters the wrong OTP code, the 
>> user
>> should be allowed to retry another OTP code. However, what actually 
>> happens
>> is that the user is taken to a default IS error page with following error
>> trace :
>>
>> [2018-10-10 15:26:01,298] ERROR
>> {org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler}
>> -  Code mismatch
>> org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException:
>> Code mismatch
>> at
>> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.processAuthenticationResponse(EmailOTPAuthenticator.java:242)
>> at
>> org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:77)
>> at
>> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.process(EmailOTPAuthenticator.java:125)
>> at
>> org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler.doAuthentication(DefaultStepHandler.java:490)
>>
>> [2018-10-10 15:26:01,362] ERROR
>> {org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator}
>> -  Exception in Authentication Framework
>> java.lang.NullPointerException
>> at
>> 

Re: [Dev] [IS 560] Adaptive authentication - How to handle retry scenarios

2018-10-11 Thread Hasitha De Silva
I did try this with 5.7.0 as well .. however the NPE was still there.

Best Regards,

On Thu, Oct 11, 2018 at 1:54 PM Ruwan Abeykoon  wrote:

> Hi Hasitha,
> Will you able to try this on IS 5.7.0 ?
> Adaptive authentication was in dev state as at IS 5.6.0.
> Cheers,
> Ruwan
>
> On Thu, Oct 11, 2018 at 5:01 PM Hasitha De Silva 
> wrote:
>
>> Thanks a lot Hasintha.
>>
>> I tried with the above approach and still got an NPE. Created a PR with a
>> possible fix.
>>
>> https://github.com/wso2-extensions/identity-extension-utils/pull/13
>>
>> Do let me know if there is a better approach that works out of the box.
>>
>> Best Regards,
>>
>> On Thu, Oct 11, 2018 at 12:29 PM Hasintha Indrajee 
>> wrote:
>>
>>> I am using the below script to re-attempt on failures from step1;
>>>
>>>
>>> var rolesToStepUp = ['admin', 'Manager'];
>>>
>>> var errorPageParameters = {
>>>
>>>'status': 'Unauthorized',
>>>
>>>'statusMsg': 'You are not authorized to access this application'
>>>
>>> };
>>>
>>> var errorPage = '';
>>>
>>> function onLoginRequest(context) {
>>>
>>>   executeBasicAuth(context);
>>>
>>> }
>>>
>>> function executeBasicAuth(context) {
>>>
>>>   executeStep(1,{
>>>
>>>   onSuccess: function (context) {
>>>
>>>  // Extracting authenticated subject from the first step
>>>
>>>var user = context.currentKnownSubject;
>>>
>>>// Checking if the user is assigned to one of the given roles
>>>
>>>var hasRole = hasAnyOfTheRoles(user, rolesToStepUp);
>>>
>>>if (hasRole) {
>>>
>>>Log.info(user.username + ' Has one of Roles: ' +
>>> rolesToStepUp.toString());
>>>
>>>executeStep(2);
>>>
>>>} else {
>>>
>>>  sendError(errorPage, errorPageParameters);
>>>
>>> }
>>>
>>>   },
>>>
>>>   onFail: function (context) {
>>>
>>> executeBasicAuth(context);
>>>
>>>   }
>>>
>>>
>>>
>>>   });
>>>
>>> }
>>>
>>>
>>> On Thu, Oct 11, 2018 at 2:10 PM Hasitha De Silva 
>>> wrote:
>>>
 [+ maduranga]

 On Wed, Oct 10, 2018 at 3:46 PM Hasitha De Silva 
 wrote:

> Hi,
>
> I'm having some trouble trying to simulate the login failure scenarios
> with conditional auth scripts. What is the ideal way to enforce the script
> to retry login attempts ?
>
> Right now my script is as below;
>
> function onLoginRequest(context) {
> executeStep(1, {
> onSuccess: function(context) {
> if (!checkIP(context)) {
> if (!checkIPInSubnet(context)) {
> if (step2CheckEmail(context)) {
> executeStep(2, {
> onFail: function(context) {
> executeStep(2);
> }
> });
> }
> }
> }
> },
> onFail: function(context) {
> executeStep(1);
> }
> });
> }
>
> The expected flow is that the user is taken to the email otp page
> after basic login, and then, if he/she enters the wrong OTP code, the user
> should be allowed to retry another OTP code. However, what actually 
> happens
> is that the user is taken to a default IS error page with following error
> trace :
>
> [2018-10-10 15:26:01,298] ERROR
> {org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler}
> -  Code mismatch
> org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException:
> Code mismatch
> at
> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.processAuthenticationResponse(EmailOTPAuthenticator.java:242)
> at
> org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:77)
> at
> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.process(EmailOTPAuthenticator.java:125)
> at
> org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler.doAuthentication(DefaultStepHandler.java:490)
>
> [2018-10-10 15:26:01,362] ERROR
> {org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator}
> -  Exception in Authentication Framework
> java.lang.NullPointerException
> at
> org.wso2.carbon.extension.identity.helper.FederatedAuthenticatorUtil.setUsernameFromFirstStep(FederatedAuthenticatorUtil.java:399)
> at
> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.initiateAuthenticationRequest(EmailOTPAuthenticator.java:160)
> at
> 

Re: [Dev] [IS 560] Adaptive authentication - How to handle retry scenarios

2018-10-11 Thread Ruwan Abeykoon
Hi Hasitha,
Will you able to try this on IS 5.7.0 ?
Adaptive authentication was in dev state as at IS 5.6.0.
Cheers,
Ruwan

On Thu, Oct 11, 2018 at 5:01 PM Hasitha De Silva 
wrote:

> Thanks a lot Hasintha.
>
> I tried with the above approach and still got an NPE. Created a PR with a
> possible fix.
>
> https://github.com/wso2-extensions/identity-extension-utils/pull/13
>
> Do let me know if there is a better approach that works out of the box.
>
> Best Regards,
>
> On Thu, Oct 11, 2018 at 12:29 PM Hasintha Indrajee 
> wrote:
>
>> I am using the below script to re-attempt on failures from step1;
>>
>>
>> var rolesToStepUp = ['admin', 'Manager'];
>>
>> var errorPageParameters = {
>>
>>'status': 'Unauthorized',
>>
>>'statusMsg': 'You are not authorized to access this application'
>>
>> };
>>
>> var errorPage = '';
>>
>> function onLoginRequest(context) {
>>
>>   executeBasicAuth(context);
>>
>> }
>>
>> function executeBasicAuth(context) {
>>
>>   executeStep(1,{
>>
>>   onSuccess: function (context) {
>>
>>  // Extracting authenticated subject from the first step
>>
>>var user = context.currentKnownSubject;
>>
>>// Checking if the user is assigned to one of the given roles
>>
>>var hasRole = hasAnyOfTheRoles(user, rolesToStepUp);
>>
>>if (hasRole) {
>>
>>Log.info(user.username + ' Has one of Roles: ' +
>> rolesToStepUp.toString());
>>
>>executeStep(2);
>>
>>} else {
>>
>>  sendError(errorPage, errorPageParameters);
>>
>> }
>>
>>   },
>>
>>   onFail: function (context) {
>>
>> executeBasicAuth(context);
>>
>>   }
>>
>>
>>
>>   });
>>
>> }
>>
>>
>> On Thu, Oct 11, 2018 at 2:10 PM Hasitha De Silva 
>> wrote:
>>
>>> [+ maduranga]
>>>
>>> On Wed, Oct 10, 2018 at 3:46 PM Hasitha De Silva 
>>> wrote:
>>>
 Hi,

 I'm having some trouble trying to simulate the login failure scenarios
 with conditional auth scripts. What is the ideal way to enforce the script
 to retry login attempts ?

 Right now my script is as below;

 function onLoginRequest(context) {
 executeStep(1, {
 onSuccess: function(context) {
 if (!checkIP(context)) {
 if (!checkIPInSubnet(context)) {
 if (step2CheckEmail(context)) {
 executeStep(2, {
 onFail: function(context) {
 executeStep(2);
 }
 });
 }
 }
 }
 },
 onFail: function(context) {
 executeStep(1);
 }
 });
 }

 The expected flow is that the user is taken to the email otp page after
 basic login, and then, if he/she enters the wrong OTP code, the user should
 be allowed to retry another OTP code. However, what actually happens is
 that the user is taken to a default IS error page with following error
 trace :

 [2018-10-10 15:26:01,298] ERROR
 {org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler}
 -  Code mismatch
 org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException:
 Code mismatch
 at
 org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.processAuthenticationResponse(EmailOTPAuthenticator.java:242)
 at
 org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:77)
 at
 org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.process(EmailOTPAuthenticator.java:125)
 at
 org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler.doAuthentication(DefaultStepHandler.java:490)

 [2018-10-10 15:26:01,362] ERROR
 {org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator}
 -  Exception in Authentication Framework
 java.lang.NullPointerException
 at
 org.wso2.carbon.extension.identity.helper.FederatedAuthenticatorUtil.setUsernameFromFirstStep(FederatedAuthenticatorUtil.java:399)
 at
 org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.initiateAuthenticationRequest(EmailOTPAuthenticator.java:160)
 at
 org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:71)
 at
 org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.process(EmailOTPAuthenticator.java:125)


 Appreciate any help :)


 Best Regards,

>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> 

Re: [Dev] [IS 560] Adaptive authentication - How to handle retry scenarios

2018-10-11 Thread Hasitha De Silva
Thanks a lot Hasintha.

I tried with the above approach and still got an NPE. Created a PR with a
possible fix.

https://github.com/wso2-extensions/identity-extension-utils/pull/13

Do let me know if there is a better approach that works out of the box.

Best Regards,

On Thu, Oct 11, 2018 at 12:29 PM Hasintha Indrajee 
wrote:

> I am using the below script to re-attempt on failures from step1;
>
>
> var rolesToStepUp = ['admin', 'Manager'];
>
> var errorPageParameters = {
>
>'status': 'Unauthorized',
>
>'statusMsg': 'You are not authorized to access this application'
>
> };
>
> var errorPage = '';
>
> function onLoginRequest(context) {
>
>   executeBasicAuth(context);
>
> }
>
> function executeBasicAuth(context) {
>
>   executeStep(1,{
>
>   onSuccess: function (context) {
>
>  // Extracting authenticated subject from the first step
>
>var user = context.currentKnownSubject;
>
>// Checking if the user is assigned to one of the given roles
>
>var hasRole = hasAnyOfTheRoles(user, rolesToStepUp);
>
>if (hasRole) {
>
>Log.info(user.username + ' Has one of Roles: ' +
> rolesToStepUp.toString());
>
>executeStep(2);
>
>} else {
>
>  sendError(errorPage, errorPageParameters);
>
> }
>
>   },
>
>   onFail: function (context) {
>
> executeBasicAuth(context);
>
>   }
>
>
>
>   });
>
> }
>
>
> On Thu, Oct 11, 2018 at 2:10 PM Hasitha De Silva 
> wrote:
>
>> [+ maduranga]
>>
>> On Wed, Oct 10, 2018 at 3:46 PM Hasitha De Silva 
>> wrote:
>>
>>> Hi,
>>>
>>> I'm having some trouble trying to simulate the login failure scenarios
>>> with conditional auth scripts. What is the ideal way to enforce the script
>>> to retry login attempts ?
>>>
>>> Right now my script is as below;
>>>
>>> function onLoginRequest(context) {
>>> executeStep(1, {
>>> onSuccess: function(context) {
>>> if (!checkIP(context)) {
>>> if (!checkIPInSubnet(context)) {
>>> if (step2CheckEmail(context)) {
>>> executeStep(2, {
>>> onFail: function(context) {
>>> executeStep(2);
>>> }
>>> });
>>> }
>>> }
>>> }
>>> },
>>> onFail: function(context) {
>>> executeStep(1);
>>> }
>>> });
>>> }
>>>
>>> The expected flow is that the user is taken to the email otp page after
>>> basic login, and then, if he/she enters the wrong OTP code, the user should
>>> be allowed to retry another OTP code. However, what actually happens is
>>> that the user is taken to a default IS error page with following error
>>> trace :
>>>
>>> [2018-10-10 15:26:01,298] ERROR
>>> {org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler}
>>> -  Code mismatch
>>> org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException:
>>> Code mismatch
>>> at
>>> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.processAuthenticationResponse(EmailOTPAuthenticator.java:242)
>>> at
>>> org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:77)
>>> at
>>> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.process(EmailOTPAuthenticator.java:125)
>>> at
>>> org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler.doAuthentication(DefaultStepHandler.java:490)
>>>
>>> [2018-10-10 15:26:01,362] ERROR
>>> {org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator}
>>> -  Exception in Authentication Framework
>>> java.lang.NullPointerException
>>> at
>>> org.wso2.carbon.extension.identity.helper.FederatedAuthenticatorUtil.setUsernameFromFirstStep(FederatedAuthenticatorUtil.java:399)
>>> at
>>> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.initiateAuthenticationRequest(EmailOTPAuthenticator.java:160)
>>> at
>>> org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:71)
>>> at
>>> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.process(EmailOTPAuthenticator.java:125)
>>>
>>>
>>> Appreciate any help :)
>>>
>>>
>>> Best Regards,
>>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
> --
> Hasintha Indrajee
> WSO2, Inc.
> Mobile:+94 771892453
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS 560] Adaptive authentication - How to handle retry scenarios

2018-10-11 Thread Hasintha Indrajee
I am using the below script to re-attempt on failures from step1;


var rolesToStepUp = ['admin', 'Manager'];

var errorPageParameters = {

   'status': 'Unauthorized',

   'statusMsg': 'You are not authorized to access this application'

};

var errorPage = '';

function onLoginRequest(context) {

  executeBasicAuth(context);

}

function executeBasicAuth(context) {

  executeStep(1,{

  onSuccess: function (context) {

 // Extracting authenticated subject from the first step

   var user = context.currentKnownSubject;

   // Checking if the user is assigned to one of the given roles

   var hasRole = hasAnyOfTheRoles(user, rolesToStepUp);

   if (hasRole) {

   Log.info(user.username + ' Has one of Roles: ' +
rolesToStepUp.toString());

   executeStep(2);

   } else {

 sendError(errorPage, errorPageParameters);

}

  },

  onFail: function (context) {

executeBasicAuth(context);

  }



  });

}


On Thu, Oct 11, 2018 at 2:10 PM Hasitha De Silva 
wrote:

> [+ maduranga]
>
> On Wed, Oct 10, 2018 at 3:46 PM Hasitha De Silva 
> wrote:
>
>> Hi,
>>
>> I'm having some trouble trying to simulate the login failure scenarios
>> with conditional auth scripts. What is the ideal way to enforce the script
>> to retry login attempts ?
>>
>> Right now my script is as below;
>>
>> function onLoginRequest(context) {
>> executeStep(1, {
>> onSuccess: function(context) {
>> if (!checkIP(context)) {
>> if (!checkIPInSubnet(context)) {
>> if (step2CheckEmail(context)) {
>> executeStep(2, {
>> onFail: function(context) {
>> executeStep(2);
>> }
>> });
>> }
>> }
>> }
>> },
>> onFail: function(context) {
>> executeStep(1);
>> }
>> });
>> }
>>
>> The expected flow is that the user is taken to the email otp page after
>> basic login, and then, if he/she enters the wrong OTP code, the user should
>> be allowed to retry another OTP code. However, what actually happens is
>> that the user is taken to a default IS error page with following error
>> trace :
>>
>> [2018-10-10 15:26:01,298] ERROR
>> {org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler}
>> -  Code mismatch
>> org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException:
>> Code mismatch
>> at
>> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.processAuthenticationResponse(EmailOTPAuthenticator.java:242)
>> at
>> org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:77)
>> at
>> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.process(EmailOTPAuthenticator.java:125)
>> at
>> org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler.doAuthentication(DefaultStepHandler.java:490)
>>
>> [2018-10-10 15:26:01,362] ERROR
>> {org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator}
>> -  Exception in Authentication Framework
>> java.lang.NullPointerException
>> at
>> org.wso2.carbon.extension.identity.helper.FederatedAuthenticatorUtil.setUsernameFromFirstStep(FederatedAuthenticatorUtil.java:399)
>> at
>> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.initiateAuthenticationRequest(EmailOTPAuthenticator.java:160)
>> at
>> org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:71)
>> at
>> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.process(EmailOTPAuthenticator.java:125)
>>
>>
>> Appreciate any help :)
>>
>>
>> Best Regards,
>>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
Hasintha Indrajee
WSO2, Inc.
Mobile:+94 771892453
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS 560] Adaptive authentication - How to handle retry scenarios

2018-10-11 Thread Hasitha De Silva
[+ maduranga]

On Wed, Oct 10, 2018 at 3:46 PM Hasitha De Silva 
wrote:

> Hi,
>
> I'm having some trouble trying to simulate the login failure scenarios
> with conditional auth scripts. What is the ideal way to enforce the script
> to retry login attempts ?
>
> Right now my script is as below;
>
> function onLoginRequest(context) {
> executeStep(1, {
> onSuccess: function(context) {
> if (!checkIP(context)) {
> if (!checkIPInSubnet(context)) {
> if (step2CheckEmail(context)) {
> executeStep(2, {
> onFail: function(context) {
> executeStep(2);
> }
> });
> }
> }
> }
> },
> onFail: function(context) {
> executeStep(1);
> }
> });
> }
>
> The expected flow is that the user is taken to the email otp page after
> basic login, and then, if he/she enters the wrong OTP code, the user should
> be allowed to retry another OTP code. However, what actually happens is
> that the user is taken to a default IS error page with following error
> trace :
>
> [2018-10-10 15:26:01,298] ERROR
> {org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler}
> -  Code mismatch
> org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException:
> Code mismatch
> at
> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.processAuthenticationResponse(EmailOTPAuthenticator.java:242)
> at
> org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:77)
> at
> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.process(EmailOTPAuthenticator.java:125)
> at
> org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler.doAuthentication(DefaultStepHandler.java:490)
>
> [2018-10-10 15:26:01,362] ERROR
> {org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator}
> -  Exception in Authentication Framework
> java.lang.NullPointerException
> at
> org.wso2.carbon.extension.identity.helper.FederatedAuthenticatorUtil.setUsernameFromFirstStep(FederatedAuthenticatorUtil.java:399)
> at
> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.initiateAuthenticationRequest(EmailOTPAuthenticator.java:160)
> at
> org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:71)
> at
> org.wso2.carbon.identity.authenticator.emailotp.EmailOTPAuthenticator.process(EmailOTPAuthenticator.java:125)
>
>
> Appreciate any help :)
>
>
> Best Regards,
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Error while copying file from Server to Local WSO2

2018-10-11 Thread Thishani Lucas
You should give the port on which the ftp server is running.

"sftp://username:password@hostname:*port*/home/folder1;

On Thu, Oct 11, 2018 at 12:56 PM, Aman Singh 
wrote:

> Hi,
>
> I am trying to copy files of any format(xml,json etc) placed in my server.
> I want to copy all files from my server to local machine.
>
> The code for copying the file I am using is :-
>
> http://ws.apache.org/ns/synapse;>
> 
> 
> 
> sftp://username:password@hostname/home/folder1/ source>
> file:///D:/WSO2FilesTest
> .*.*
> 
> 
> 
> 
> 
> 
>
> But I am getting the error as "Could not list the contents of
> "sftp://username:***@hostname/home/folder1; because it is not a folder."
>
> The file does exist inside of the folder1.
>
> What do I need to change in my code?
>
> Thank you,
> Aman
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Thishani Lucas*
*Software Engineer*
*WSO2 Lanka (Private) Limited**: http://wso2.com *
*lean.enterprise.middle-ware*

*Tel: +94 77 2556931 *

*LinkedIn: https://www.linkedin.com/in/thishani-lucas/
*



___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Error while copying file from Server to Local WSO2

2018-10-11 Thread Aman Singh
Hi,

I am trying to copy files of any format(xml,json etc) placed in my server.
I want to copy all files from my server to local machine.

The code for copying the file I am using is :-

http://ws.apache.org/ns/synapse;>



sftp://username:password@hostname
/home/folder1/
file:///D:/WSO2FilesTest
.*.*







But I am getting the error as "Could not list the contents of
"sftp://username:***@hostname/home/folder1; because it is not a folder."

The file does exist inside of the folder1.

What do I need to change in my code?

Thank you,
Aman
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Retry an Endpoint

2018-10-11 Thread Kamidu Sachith Punchihewa
Hi Junior,

You got it correct. If you in the process of enabling guaranteed delivery I
suggest the store-forward pattern.

Thanks and Best Regards,

On Wed, Oct 10, 2018 at 6:05 PM Júnior  wrote:

> Hi Kamidu,
>
> but this retry, it will be done in the same request, or it is just a
> number of times the endpoint will be used before being set as suspended? At
> least this is what I understood from the documentation.
>
> Thanks,
>
> Em qua, 10 de out de 2018 às 10:11, Kamidu Sachith Punchihewa <
> sachi...@wso2.com> escreveu:
>
>> Hi Junior,
>> You have the ability to configure the retry option and count when
>> creating the endpoint. Please refer the below sample configuration,
>>
>> http://ws.apache.org/ns/synapse; name="sample">
>>>http://localhost:8080/sample/echo;>
>>>   
>>>  1.0
>>>   
>>>   
>>>  5
>>>  600
>>>   
>>>   
>>>  1
>>>  fault
>>>   
>>>
>>> 
>>
>>
>> The above configuration is enabling the endpoint to be retried 5 times
>> with a timeout.
>>
>> You can create a replay of the messages to the endpoint with more control
>> by following the store forward integration pattern. Please refer to the
>> documentation [1] for more information.
>>
>> [1]
>> https://docs.wso2.com/display/ESB480/Store+and+Forward+Using+JMS+Message+Stores
>>
>> Thanks and Best Regards,
>>
>> On Mon, Oct 8, 2018 at 2:14 AM Júnior  wrote:
>>
>>> Hi,
>>>
>>> I would like to know if there is a way of retrying an endpoint
>>> automatically in WSO2 ESB.
>>>
>>> As I could see one way of doing that is using the failover mediator with
>>> some leaf endpoints.
>>>
>>> I would like to a scenario like this:
>>>
>>> Try the endpoint and in case of a timeout, try it another two times and
>>> after a third try it would lead to a fault sequence. Using the failover
>>> mediator, it will work only if we enable the suspension of the endpoint.
>>> I would like to have it without adding suspension settings. As I could
>>> see, without the suspension settings, the failover endpoint will try the
>>> request forever until the endpoints respond correctly.
>>>
>>> Is there any way to achieve this scenario?
>>>
>>> My first idea, in case there is no OOTB solution, would be:
>>>
>>> 1. create a sequence that would have the call/send mediator. This
>>> sequence, would have a onError sequence, so in case of a timeout, we would
>>> have a condition for a retry;
>>> 2. In case of timeout, the onError would be called, and we would have a
>>> counter, in case the counter is less than 3, we would call the previous
>>> sequence, else, it would fault.
>>>
>>> Would this be a correct approach for this scenario?
>>>
>>> Thanks,
>>> --
>>> Francisco Ribeiro
>>> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>
>>
>> --
>>
>> *Kamidu Sachith Punchihewa *| Senior Software Engineer | *WSO2 Inc*.
>> (m) +94770566749 / +254778872783 | (e) sachi...@wso2.com | (ln) kamidu
>> 
>>
>> 
>>
>
>
> --
> Francisco Ribeiro
> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>


-- 

*Kamidu Sachith Punchihewa *| Senior Software Engineer | *WSO2 Inc*.
(m) +94770566749 / +254778872783 | (e) sachi...@wso2.com | (ln) kamidu



___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Dynamic Max Records on DSS

2018-10-11 Thread Sangeeth Karunaratne
Hi Junior,

The Max Rows property can only be set at deploying time of a data service ,
it is not possible to change the property at runtime.

On Thu, Oct 11, 2018 at 1:34 AM Júnior  wrote:

> Hello,
>
> I have a DSS Service that calls a stored procedure and this procedure can
> return a huge result set 10k+ records. I saw in the documentation we can
> set Max Rows property in the query to control how many records it will
> return.
>
> Is it possible to define this property in runtime, I mean by passing
> parameter to the service that would be used in the configuration? Or this
> is possible only by redeploying the service?
>
> Thanks,
> --
> Francisco Ribeiro
> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
Best Regards,
*Sangeeth Karunaratne*
Software Engineering Intern
WSO2
+94767031534
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [IAM] InCommon Federation Compliance for WSO2IS - eduPerson Claim Dialect

2018-10-11 Thread Sahan Gunathilaka
Hi All,

According to a requirement of InCommon Federation, each SAML entity should
support eduPerson attribute schema to exchange claims. Since there is not a
claim dialect in WSO2IS to support that schema, I previously mailed
mentioning about creating a new claim dialect for that.

As a further extension, there is an addition property as "*FriendlyName*"
for each claim. But, only the wso2 local claim dialect (
http://wso2.org/claims) supports to add additional property for each claim.
There is no way to add additional properties for claims in external claim
dialects. What I think is that there can be additional properties for
claims in specific external dialects too. Therefore, there should be a way
to add them for claims in external dialects as well.

I am looking forward for answers regarding this matter.

Thanks
Best Regards!


-- 
*Sahan Gunathilaka*
Intern - Software Engineering
*WSO2*
mobile:  +94776343266

[image: http://wso2.com/signature]
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] TestCaseName is not setting properly

2018-10-11 Thread Mohanadarshan Vivekanandalingam
Hi Vasanth,

It seems, you have to pass the className as the header parameter as per
yout MSF4J service implementation. Please set the className as the header
in the http sink and tryout.

Thanks,
Mohan


On Thu, Oct 11, 2018 at 10:52 AM, Vasanthan Sivalingam 
wrote:

> Hi SP team,
>
> Currently i have written a siddhi application,
>
>
>
>
>
>
>
>
>
>
>
> *@App:name('TestMinimumHA')@source(type='http', receiver.url=
> 'http://192.168.48.26:9006/endpoints
> ', topic='symbol',
> @map(type='xml'))define stream FooStream (symbol string, price float, class
> string);@sink(type='http',
> publisher.url='http://192.168.48.254:8080/testresults
> ',
> method='{{method}}',headers="'content-type:text/plain'",@map(type='json'))define
> stream BarStream (message string, value float, method string, headers
> string);from FooStream#window.length(5)select symbol as message, max(price)
> as value, 'POST' as method, class as headersinsert into BarStream;from
> BarStream#log("Events: ")insert into OutputStream;*
>
> through postman i am  passing an event with POST
> http://192.168.48.26:9006/endpoints -H content-type="plain/text"
> with body
> 
> 
> First
> 20f
> cclassName:com.sp.test.StateSync
> 
> 
>
> in the server side i am getting a response :
> [2018-10-11 03:57:10,666] INFO {org.wso2.siddhi.core.query.
> processor.stream.LogStreamProcessor} - TestMinimumHA: Events: ,
> StreamEvent{ timestamp=1539230230663, beforeWindowData=null,
> onAfterWindowData=null, outputData=[First, 20.0, POST,
> *cclassName:com.sp.test.StateSync*], type=CURRENT, next=null}
> [2018-10-11 03:57:13,387] ERROR {org.wso2.carbon.stream.
> processor.core.persistence.PersistenceManager}
>
> I am running a MSF4J in host: 192.168.48.254, port:8080,in the MSF4J side
> i am getting a response as below.
>
> 2018-10-11 03:57:11 INFO VerifyTest:144 - POST invoked
> 2018-10-11 03:57:11 INFO VerifyTest:145 - Content-Type=application/json
> 2018-10-11 03:57:11 INFO VerifyTest:145 - HTTP_METHOD=POST
> 2018-10-11 03:57:11 INFO VerifyTest:145 - connection=keep-alive
> 2018-10-11 03:57:11 INFO VerifyTest:145 - forwarded=by=192.168.48.26;
> proto=http
> 2018-10-11 03:57:11 INFO VerifyTest:145 - content-length=103
> 2018-10-11 03:57:11 INFO VerifyTest:153 - adding event under new test case.
> 2018-10-11 03:57:11 INFO VerifyTest:158 - *TestCaseName: null*
>
> Can i have some suggestions on how to set the TestCaseName as , *TestCaseName:
> com.sp.test.StateSync*
>
> Thanks,
> Vasanth
>



-- 
*V. Mohanadarshan* | Technical Lead | WSO2 Inc.  |
(M) 94-771117673 | (E) mo...@wso2.com |
GET INTEGRATION AGILE
Integration Agility for Digitally Driven Business
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev