0

I'm building a Rails API with a proper front-end to go along with it (probably React). I'm currently implementing the API and haven't written a single line of front-end. I'm trying to implement OAuth with Facebook as explained in @a14m's answer for this post.

However the problem is that my API would require an authentication code so that it can exchange it for an access token with Facebook. As far as I understand, the code is obtained via a login dialog on the front-end. Now I want to test whether or not my API is getting a valid access token from Facebook in exchange for the code. But to get the code I have to open a dialog on the "front-end" which I have not implemented yet.

Any way I could open the dialog for Facebook login and get the code without writing the front-end? I probably think Postman would help but I don't know how. Also if there is a way to obtain the token without triggering the dialog would also get my job done. So I just want a way to access the code without a front-end.

radtemporary
  • 253
  • 2
  • 8
  • user authorization needs user interaction. if you would be able to automate this for a normal user, it would make the whole login process void. take a look at test users in the developer docs. – andyrandy Feb 10 '19 at 18:42

1 Answers1

0

You can definitely use Postman for this. I write Rails APIs often and I always use Postman to hit the endpoints without having a front-end. All you have to do is find out what you need to send to the Facebook API and set it up as a form body on Postman.

Postman

hashrocket
  • 2,210
  • 1
  • 16
  • 25
  • he is not talking about api calls, those are easy to test with postman, of course. he is asking about the login process, which needs user interaction and cannot be tested with postman. – andyrandy Feb 10 '19 at 18:41