delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

Need public loginWithToken method #20

Closed futhrevo closed 9 years ago

futhrevo commented 9 years ago

What is the reason for making loginWithToken private? Is it design decision or due to security issues?

ocram commented 9 years ago

Thanks for your question!

This has been solely a design decision. Due to the fact that this library receives, stores and uses the auth token for you automatically, we thought there wouldn't be any reason why you'd need direct access to the token.

Hiding this method was therefore done to simplify the API and to avoid any confusion.

Is there any reason why you'd like to have access to that method? The API could be changed to make this public, of course. We just didn't see a reason, yet.

futhrevo commented 9 years ago

I am using this package as part of Cordova service plugin to do some background tasks, for which user need not enter any credentials but token is passed to Cordova which is used to login securely.

I modified this to public and using it locally and this method is working as expected

ocram commented 9 years ago

That totally makes sense. Thanks for trying and reporting!

Great that it works for you. If it turns out that this is a common use case or more developers need access to that method for other purposes, we'll make this public by default.

derwaldgeist commented 5 years ago

I'd like to see this public, too. In my use case, the Android native code is actually a plug-in for Unity. I want to hand over an existing login token from Unity to the plugin, so I won't have to hand-over the username and passwords instead.

idelrich commented 5 years ago

@derwaldgeist, you can make this change yourself easily enough... the Meteor.java file has a an object property....

private String mSessionID;

Either change it to public, or better add an accessor to return it... something like

public String currentSessionID() { return mSessionID; }

then add a pull request, not sure that this repo is being actively updated though...