twitter login integration in reactjs

5.3k Views Asked by At

I am trying to integrate twitter login in my webapge. I am using react-twitter-auth for this.I am not understanding what I have to pass in place of loginurl and request token url. can you please let me know what I have to use in this place.

ex:

<TwitterLogin loginUrl="http://localhost:4000/api/v1/auth/twitter"
              onFailure={this.onFailed}
              onSuccess={this.onSuccess}
              requestTokenUrl="http://localhost:4000/api/v1/auth/twitter/reverse"
              showIcon={true}
              customHeaders={customHeader}>
    <b>Custom</b> 
      Twitter 
    <i>Login</i> content
</TwitterLogin> 
2

There are 2 best solutions below

1
Imesh Chandrasiri On

You have to have a backend to validate the authentication of twitter. The following tutorial show's how the implementation is done.

Twitter Implementation

1
Soniya Rana On

loginurl - URL that will be used to finish 3rd step of authentication process and request token url - URL that will be used to get request token

check this github repo -- https://github.com/alien35/social-auth-example it helped me.