0

I am trying to build an app which has Django DRF Backend and React Frontend. I used 'oauth2_provider' and 'rest_framework_social_oauth2' on Backend.

I succeeded to get the facebook access_token by only using React Frontend. Send it to Backend and get the converted token.

In case of twitter, is it possible to get tha access_token by only using React?

Looking forward to your adivce. :)

Zhong Ri
  • 2,556
  • 1
  • 19
  • 23
  • I don't think there would be any issue to do it. Twitter (and any other API for that matter) doesn't know whether you are sending an http request to their service from frontend or backend. Sure, some might check your request 'user-agent' headers, but even that can be spoofed. – Jackyef Jun 07 '18 at 08:32

1 Answers1

0

After a few days of survey, I found that Twitter access_token have to be obtained on backend.

On frontend, can send request and 200 response but browser shows CORS error.

I guess it means that request for Twitter access_token should be sent from backend, not from browser.

I've succeeded to get Twitter access_token on Backend(Python/Django).

Zhong Ri
  • 2,556
  • 1
  • 19
  • 23