How can we twitter OAuth without social login?

Hi.

I want to use Twitter OAuth with Auth0.
But we don’t want to use the social login only using OAuth token and Twitter APIs.

Can we do that? If it is yes, how can we implement that?

Hi @daiki44,

Welcome to the Community!

To clarify, could you please explain your use case further? Will your app need to make API requests to Twitter? Or will users need to log in via Twitter?

Thank you in advance!

Thank you for your quick response!

could you please explain your use case further?

  • Our App Login
    Another OAuth login (using LINE)

  • Twitter OAuth
    For getting the user’s timeline (after line login). like the “connect your Twitter” button.

Will your app need to make API requests to Twitter? Or will users need to log in via Twitter?

I need to make API requests to Twitter.

Thank you for your support!

Thanks for providing additional context!

To authenticate your app to use Twitter’s API, you can use the Client Credentials Flow. This must be done server-side since it will require using a client secret. Your API/backend can authenticate with Twitter directly with the Twitter /token endpoint:

https://developer.twitter.com/en/docs/authentication/api-reference/token

In your frontend application, you can register your custom API and use its identifier as the audience in your app. When a user logs in, they will be issued an Access Token which your backend can validate before authenticating with Twitter.

Thank you for your answer!
I will try it.

I have one more question.
Should we create two applications in Auth0? Is it correct? (1. LINE Login, 2. Twitter OAuth)

Not a problem!

For this set up, you will only need one application and one API. Your backend can retrieve an Access Token directly from Twitter by using the client credentials grant, and so you won’t need to set up an application in Auth0 for it.

By setting up an API in Auth0, you can ensure that any of your API endpoints will only be used by logged-in users.

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