Communicating auth info while calling services through runSync

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Communicating auth info while calling services through runSync

Deepaks
I have been trying to access certain services through runSync and am unable to get through.

I always get "You must be logged in to complete the [create a EntityName] process." though I have turned auth=false just to test it out. But I think it should have authentication turned on anyways. So is there any way I can pass on user information into it?

Thanks in advance

PS: Basically, its part of moving an application to ZK interface. I have built a form, then creating a context map and calling runSync.
Reply | Threaded
Open this post in threaded view
|

Re: Communicating auth info while calling services through runSync

David E Jones

If you are implementing your service using a simple-method it has  
security settings too (on the simple-method element itself). You'll  
need to tell it to not require auth there as well.

-David


On Feb 4, 2008, at 2:24 PM, Deepaks wrote:

>
> I have been trying to access certain services through runSync and am  
> unable
> to get through.
>
> I always get "You must be logged in to complete the [create a  
> EntityName]
> process." though I have turned auth=false just to test it out. But I  
> think
> it should have authentication turned on anyways. So is there any way  
> I can
> pass on user information into it?
>
> Thanks in advance
>
> PS: Basically, its part of moving an application to ZK interface. I  
> have
> built a form, then creating a context map and calling runSync.
> --
> View this message in context: http://www.nabble.com/Communicating-auth-info-while-calling-services-through-runSync-tp15277937p15277937.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: Communicating auth info while calling services through runSync

Rashko Rejmer
In reply to this post by Deepaks
Hi,

Maybe you can pass the userLogin GV to the IN Map.

E.g.:
dispatcher.runSync("setPaymentStatus", UtilMisc.toMap("userLogin",
userLogin, .............

Regards,
Rashko Rejmer


On Mon, 2008-02-04 at 13:24 -0800, Deepaks wrote:

> I have been trying to access certain services through runSync and am unable
> to get through.
>
> I always get "You must be logged in to complete the [create a EntityName]
> process." though I have turned auth=false just to test it out. But I think
> it should have authentication turned on anyways. So is there any way I can
> pass on user information into it?
>
> Thanks in advance
>
> PS: Basically, its part of moving an application to ZK interface. I have
> built a form, then creating a context map and calling runSync.

Reply | Threaded
Open this post in threaded view
|

Re: Communicating auth info while calling services through runSync

Deepaks
Thanks to both David and Rashko, I had missed the login-required
parameter in simple-method.

Now I can create an entity, so most of my code works :)

But now I have to try what Rashko suggested and see how it goes. As
creation of such things wont be good without authorized use.

Thanks again, will post back the results and maybe add few things to
the zk docs.


On Feb 5, 2008 3:06 AM, Rashko Rejmer <[hidden email]> wrote:

> Hi,
>
> Maybe you can pass the userLogin GV to the IN Map.
>
> E.g.:
> dispatcher.runSync("setPaymentStatus", UtilMisc.toMap("userLogin",
> userLogin, .............
>
> Regards,
> Rashko Rejmer
>
>
>
> On Mon, 2008-02-04 at 13:24 -0800, Deepaks wrote:
> > I have been trying to access certain services through runSync and am unable
> > to get through.
> >
> > I always get "You must be logged in to complete the [create a EntityName]
> > process." though I have turned auth=false just to test it out. But I think
> > it should have authentication turned on anyways. So is there any way I can
> > pass on user information into it?
> >
> > Thanks in advance
> >
> > PS: Basically, its part of moving an application to ZK interface. I have
> > built a form, then creating a context map and calling runSync.
>
>