Noob looking for help with Oauth


#1

I’m new to this API, and newish overall, and I’ve been experimenting with trying to get authentication to work. I have a webpage with only a front-end and I’ve been trying to use Oauth libraries I’ve found at random to send authentication. This has failed.

Is it possible to do this? GET and POST with no backend? I don’t think it is possible to send keys in the URL but can I use a library to do it?

I’ve been able to get the basics to work with Twurl - so I know my keys and app work - but the project I have does not have access to the command line or have a server.

I’ve been trying to get this to work https://github.com/andreassolberg/jso but no idea if I’m in the right place. I don’t how to send my consumer keys, which endpoint to hit here, etc.

Is there a JS Oauth library that will allow me to do what I want? That is authenticate me by sending the correct data to twitter from the browser only. (I think learning this will help me with all APIs)

Any help will be appreciated!


#2

It is not recommended to authenticate from your front-end app. For security reasons I strongly recommend you do this from a backend. Besides, there’s a great chance you won’t be able to authenticate from JS because of CORS.


#3

This is correct. The API does not support CORS, so you’re very unlikely to be able to use it from a front-end app directly.


#4

Thanks for the update. I wanted to find a work around but I guess adding a server will be easier. So that is what I will do then.


#5

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.