Hi Chathuri, Supun, Yes, you can disable securing the API when writing integration tests which run without IS. You can pass null value to the AuthzToken parameter in such cases.
I actually have listed the steps to follow when adding a new method to the API with the secured API at https://cwiki.apache.org/confluence/display/AIRAVATA/Developer+Documentation+for+Securing+Airavata+API and linked from the jira issue https://issues.apache.org/jira/browse/AIRAVATA-1624 when sending the pull request. Please note that in this initial version, I have changed only the getAPIVersion method and updated only the java stubs by running the script with 'update java stubs' options. I will change all the other API methods and to update other language client stubs in the same way, after the feedback - if there is no any objections for that approach. Thanks & Best Regards, Hasini. On Tue, Jun 2, 2015 at 4:55 PM, Chathuri Wimalasena <kamalas...@gmail.com> wrote: > Thanks Supun. I did the same in the CreateLaunchExperiment class. It fixed > the issue. > > On Tue, Jun 2, 2015 at 4:47 PM, Supun Nakandala <supun.nakand...@gmail.com > > wrote: > >> Hi, >> >> I had the same issue. There is a property in the >> airavata-server.properties to disable security API changes(in the bottom of >> the file). Even if you disable that when invoking getAPIVersion method you >> still have to send a authzToken with some token value. I had to do the >> below changes in PHP >> >> $authzToken = new Airavata\Model\Security\AuthzToken(); >> $authzToken->accessToken = "emptyToken"; >> $apiVersion = Airavata::getAPIVersion($authzToken); >> >> I am not sure I am doing things correctly. But this fixed my issue. >> >> >> >> On Wed, Jun 3, 2015 at 2:09 AM, Chathuri Wimalasena <kamalas...@gmail.com >> > wrote: >> >>> Hi Hasini, >>> >>> What are the steps to run airavata server with new APIToken changes. Is >>> there a way we can disable the token for simple test cases ? >>> >>> When I try registerApplications from CreateLaunchExperiment class, I'm >>> getting following error. >>> >>> Exception in thread "main" >>> org.apache.thrift.protocol.TProtocolException: Required field 'authzToken' >>> was not present! Struct: getAPIVersion_args(authzToken:null) >>> at >>> org.apache.airavata.api.Airavata$getAPIVersion_args.validate(Airavata.java:23451) >>> at >>> org.apache.airavata.api.Airavata$getAPIVersion_args$getAPIVersion_argsStandardScheme.write(Airavata.java:23514) >>> at >>> org.apache.airavata.api.Airavata$getAPIVersion_args$getAPIVersion_argsStandardScheme.write(Airavata.java:23481) >>> at >>> org.apache.airavata.api.Airavata$getAPIVersion_args.write(Airavata.java:23429) >>> at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:63) >>> at >>> org.apache.airavata.api.Airavata$Client.send_getAPIVersion(Airavata.java:2106) >>> at >>> org.apache.airavata.api.Airavata$Client.getAPIVersion(Airavata.java:2098) >>> at >>> org.apache.airavata.client.samples.CreateLaunchExperiment.main(CreateLaunchExperiment.java:83) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) >>> at >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >>> at java.lang.reflect.Method.invoke(Method.java:483) >>> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) >>> >>> Thanks.. >>> Chathuri >>> >> >> >> >> -- >> Thank you >> Supun Nakandala >> Dept. Computer Science and Engineering >> University of Moratuwa >> > >