Twitter Social Login with Magic
Twitter Social Login with Magic
#Overview
You can allow your users to sign up & log in to your web application with their Twitter account.
#Usage
#Prerequisites
- You will need a Twitter Developer account (only free access is required)
- Note: Twitter has recently deprecated their legacy Twitter API access tiers (essential and elevated packages are no longer available). If your application has been suspended as part of this, please sign up for the Free access tier to have it unsuspended.
- You will need to have the Magic SDK installed into your web application
- You will need to have the Magic SDK - OAuth Extension installed into your web application
#Twitter Setup (v1 extension)
After installing the OAuth extension, you can now enable Twitter Login for your Magic application:
- Go to your Magic Dashboard
- Select the Magic application for which you’d like to enable Twitter Login, or create a new application
- Navigate to Social Login from the sidebar
- Click the toggle for Twitter
- Copy the Redirect URI field from your Magic Dashboard
- Go to Twitter App Dashboard and navigate to Projects & Apps
- In the Overview section, click on Add Project
- Add your project name, use case and description
- Make sure to copy the API Key and API Key Secret to the Magic dashboard, which you can then use with your application that connects to Twitter
- Navigate to the application on the sidebar and click Set up under User authentication settings
- Fill out all of the required permissions and app type information
- Paste the Redirect URI from the Magic Dashboard in the Callback URI / Redirect URL and add your applications Website URL
- After saving these details for the first time, Twitter will then display an OAuth 2.0 Client ID and Client Secret. IMPORTANT: These are NOT the keys that Magic requires and can be ignored. The correct keys are the API Key and API Key Secret from step 9 of this walkthrough.
- Return to your Magic Dashboard and click "Test Connection" to give your new Twitter OAuth flow a try!
#Twitter Setup (v2 extension)
- Go to your Magic Dashboard
- Select the Magic application for which you’d like to enable Twitter Login, or create a new application
- Navigate to Social Login from the sidebar
- Click the toggle for Twitter
- Go to Twitter App Dashboard and navigate to Projects & Apps
- In the Overview section, click on Add Project
- Add your project name, use case and description
- Do NOT use the API Key and Secret under Consumer Keys. Make sure to copy the Client ID and Client Secret to the Magic dashboard, which you can then use with your application that connects to Twitter. Complete flow if OAuth 2.0 Client ID and Client Secret are not visible
- Navigate to the application on the sidebar and click Set up under User authentication settings
- Fill out all of the required permissions and app type information
- Paste the Redirect URI you will pass as the redirectURI argument to the loginWithRedirect method, in the Callback URI / Redirect URL and add your applications Website URL
- After saving these details for the first time, Twitter will then display an OAuth 2.0 Client ID and Client Secret. IMPORTANT: These are the keys that Magic requires to use v2. Do NOT use the API Key and API Key Secret for v2.
- "Test Connection" function in dashboard will not work for v2.