-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpInvocation.invoke() should support authentication #105
Comments
In other words, we need to implement authentication support in the remoting connector. |
Exactly that! 💯 |
+1 |
👍 Will this be implemented soon? Currently evaluating different frameworks and this is a must for us. |
wonderful, instead of trying to figure out how to do that, should've just done the |
+1 - this one's a dealbreaker for me too |
👍 Same question as the others, need this in order to commit to Loopback as a framework for a project |
There are two parts to this:
I am afraid this is not a high priority for us at the moment. However, since LoopBack is an open-source project, would you mind to implement this change yourself and submit a pull request? |
Thanks for being open to a pull request. No problem about low priority, I will consider it "part of the task" to get something like this in place if we decide to move this direction. We're definitely leaning toward Strongloop's stack (in general), I'll let you know. Thanks for the response! |
@brianfeister That's great to hear. I am happy to help you with the patch and guide you along the way to get the pull request into the state when it can be accepted. Feel free to open a pull request as soon as you have something working, even if it's not complete. |
Thanks for the prompt response and concise direction for pull requests. Responsiveness of core devs is definitely a contributing factor for people choosing a framework |
Is there anyone working on this? If so I would like to help move it along, if not, I will be forming a PR. @bajtos If there is no one working on this I will need some guidance on where to get started. |
I'm not currently working on this because I'm not using StrongLoop for this yet. Have at it @BerkeleyTrue |
Will do! |
@BerkeleyTrue cool! let me know when you need help. |
@bajtos Looks this I will start working on this tomorrow. When you say loopback-remote-connector do you mean the loopback-connector-remote package or the connectors specific to strong-remoting? |
The former, see https://github.com/strongloop/loopback-connector-remote |
@bajtos I have adding headers working through loopback-remote-connector and auth working similar to how angular sdk does auth. My problem at the moment is I cannot get the custom user methods to work with strong-remoting, like login/logout. It seems like User only picks up the basic PersistedModel methods but not the custom ones. Can I get some guidance as to how to create the remote methods for those? |
Seems the issue is the fact that currently the built in user model uses loopback.remoteMethod instead of User.remoteMethod. |
2.11.1 * Optimize the code to remove closure and bind (Raymond Feng) * Fix parsing JSON arrays with arrayItemDelimiters on. (Samuel Reed) * Add remote hooks to RestAdapter.invoke method Hooks on invoke are needed to use methods like User.login remotely from loopback-connector-remote. see #150 and #105 and strongloop/loopback#943 (Berkeley Martinez) * Ensure Remote-Connector Converts Types in Array Fix bug strongloop/loopback#886 (Berkeley Martinez)
|
Here is a code snippet showing how to set the access token in a loopback application, assuming that the data-source backed by the remote connector is called "remote":
@ritch I find this rather difficult to use, it took me quite a lot of debugging to find out where exactly the token should be set. I think we should add some sugar API to make this easier. @crandmck Is there any documentation explaining how to configure the remoting connector? I'd like to include this information there. |
Let's follow up here: strongloop/loopback-connector-remote#3 |
@bajtos Here is the doc for the remote connector: http://docs.strongloop.com/display/LB/Remote+connector Feel free to add something there until strongloop/loopback-connector-remote#3 is resolved. |
@crandmck done, I have added a new section named "Configuring authentication". Feel free to improve the content as you wish. |
Thanks. LGTM. |
When replicating local model with remote models, it will trigger REST end points on remote server, sometimes it would be necessary to pass TOKEN in the request header for authorization, it's not possible with current implementation.
Ideally, TOKEN should be passed down all the way from persisted-model when invoking, or better yet, token can be stored somewhere (probably app.settings{} or app.configs{}) for easier access.
Here's the pseudo code of how it works if TOKEN were passed down:
In http-invocation.js:
PS. just reviewed the whole replication/diff/merge implementation, really great work, two thumbs up! Can't wait to use it in my next project.
The text was updated successfully, but these errors were encountered: