0
votes

I am using loopback 3.0 and datasource as MS SQL server, "encrypt": true

When I go to API explorer "http://localhost:3000/explorer/" it shows an Access Token by default.

How can I get this access token from an API so one can submit POST / GET from a frontend application (Angular)?

Note: I am not using any ACL at moment.

1
What is ACL? (Sorry, I am not familiar with that acronym) - Alejandro Vales
acl = access control list. its for authentication - fresher
@AlejandroVales check the loopback docs - akkonrad

1 Answers

0
votes

You need to call login first, so let's say you have a profile with email: [email protected] and password: password, you need to make a POST request to the users/login endpoint - you can see the endpoint in your explorer and you can try it there.

Then, in your response, you will get the access token which from now on you have to put in your request header: Authorization.

Everything can be found in the loopback docs: intro to user model authentication and afer that you can check making authenticated requests, I suggest to start there.