This module provides Single Sign-On (SSO) capabilities for Instagram using OAuth. The integration allows you to authenticate users, fetch user profile information, and publish media posts on behalf of users.
To start using Instagram SSO, you need to provide the following environment variables:
INSTAGRAM_CLIENT_ID
: Instagram OAuth client IDINSTAGRAM_CLIENT_SECRET
: Instagram OAuth client secret
Add these environment variables to your .env
file.
Ensure that the Instagram Basic Display API is enabled for your application. This is necessary to authenticate users and fetch user profile information.
When setting up your Instagram OAuth client, make sure to include the following scopes to request necessary permissions:
user_profile
user_media
Follow these steps to acquire your keys and set up the required environment variables:
- Go to the Instagram Developer Documentation.
- Sign in using your Facebook account associated with your Instagram Business Account.
- Navigate to the "My Apps" section and click "Create App."
- Choose the "For Everything Else" option and click "Next."
- Provide an app name and your contact email, then click "Create App ID."
- In your newly created app dashboard, locate and click "Add Product" in the sidebar.
- Find "Instagram" in the list and click "Set Up."
- In the Instagram Basic Display section, click "Create New App".
- Once the app is created, visit the "Basic Display" settings under the "Instagram" product.
- Add the necessary OAuth redirect URI based on your application's configuration.
- In the "Basic Display" section, you should see your
Client ID
andClient Secret
. - Copy these values and add them to your
.env
file asINSTAGRAM_CLIENT_ID
andINSTAGRAM_CLIENT_SECRET
.
- Ensure that you've configured the required scopes (
user_profile
,user_media
) under the Instagram Basic Display settings. - Save all changes and ensure that the app status is live.
Ensure your .env
file looks something like:
INSTAGRAM_CLIENT_ID=your_client_id_here
INSTAGRAM_CLIENT_SECRET=your_client_secret_here