sacOO7 / socketcluster-client-java

Native java and android client for socketcluster framework in node.js
http://socketcluster.io/
Apache License 2.0
94 stars 42 forks source link

Subscribe #16

Open nakul91 opened 6 years ago

nakul91 commented 6 years ago

Need to pass the arguments to subscribe as an issue of security.

sacOO7 commented 6 years ago

Can you describe your problem in detail?

joysonvd commented 6 years ago

Hey Sachin,

In the javascript client I can do the following when subscribing to a channel. channel = socket.subscribe(${userid}, { data : {userid : ${userid}, token : 'eyJhbGciOiJSUzI1NiIsInR5cCI6Ikp'} });

So we want to know if a similar thing can be done in the Android client as well. We use the user id and token to authenticate the subscribe request.

Regards, Joyson.

nakul91 commented 6 years ago

any update on the above issue.

sacOO7 commented 6 years ago

Hi @nakul91 can you describe your problem in more detail?

nakul91 commented 6 years ago

Hi @sacOO7 right now we cannot authenticate the subscribe functionality as its just a call back function as follow: socket.createChannel(" XX ").subscribe(new Ack() { @Override public void call(String name, Object error, Object data) {

        }
    });

in the backend, they have updated the authentication with the token as specified by @joysonvd in the above posts. So how can we update the token while subscribing, in android?

kuhnp commented 6 years ago

I have the same problem, I need to add a jwt token in the data payload. But unfortunately, this is not exposed by the subscribe method. Any update?

nakul91 commented 6 years ago

@sacOO7 this issue got fixed in ios but not in the android can you pls fix this up.

nakul91 commented 6 years ago

@sacOO7 this can help https://github.com/sacOO7/socketcluster-client-swift/pull/5/commits/2a60fac9182ca3f0d3e60996ea96ce1a137b0cd1

sacOO7 commented 6 years ago

Yes sure @nakul91 , I will take a look at it....

nakul91 commented 6 years ago

@sacOO7 thanks 👍

joysonvd commented 6 years ago

Hi @sacOO7, Have you been able to get through to this.

sacOO7 commented 6 years ago

Will probably work on it today and let you know about it 👍

On Jun 1, 2018 10:40 AM, "joysonvd" notifications@github.com wrote:

Hi @sacOO7 https://github.com/sacOO7, Have you been able to get through to this.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sacOO7/socketcluster-client-java/issues/16#issuecomment-393759552, or mute the thread https://github.com/notifications/unsubscribe-auth/AP8vSXY6WOi9N8dvj66iGW3gHCUcEx94ks5t4MzTgaJpZM4Pm2Jw .

nakul91 commented 6 years ago

Hi @sacOO7 any update on this issue

sacOO7 commented 6 years ago

Hi @nakul91 , I am currently porting all functionality from js client to java. You can find updated here. Since I am working on Unity client, this will take some time to complete. https://github.com/sacOO7/socketcluster-client-java/tree/feature/syncJsClient.