Thursday, 20 April 2017

How to add Authentication to Loopback Custom API

I am Creating a small Loopback application for Authentication and Authorization. To Develop this app I following These Steps -

  1. First I added a data source in datascource,json file.
  2. Enable the server.enableAuth(); in boot Script.
  3. Created a Custom employee Model with base 'User' Model.
  4. added this Model in model-config.json with datasource.
  5. I Created a another Model 'Employeefeedbacks' and also add this in model-config.json.
  6. I create a Get method in 'Employeefeedbacks.js' file and return string data.
  7. when i test this Get api than it return String data.

So problem is that , I want the Authenticate first and than it can return data . How can i do it . any idea .

Please tell me if you need more info !!!



via Rakesh

No comments:

Post a Comment