Skip to content

Instagram integration: token exchange fails with "Unsupported request - method type: get" #5531

@adamh123-git

Description

@adamh123-git

Bug Description

When completing the Instagram OAuth flow, the token exchange step fails with an instagram_token_request_error. Instagram's token endpoint (https://api.instagram.com/oauth/access_token) only accepts POST requests, but it appears Nango is sending a GET request during the token exchange.

Error

AuthError: {
"name": "Error",
"message": "An unhandled error of type 'instagram_token_request_error' with payload '"{ "message": "Request failed with status code 400", "name": "AxiosError", "provider_error_payload": { "message": "Unsupported request - method type: get" } }"' has occurred"
}

Steps to Reproduce

  1. Configure an instagram integration with valid Instagram App ID and Secret (from the Meta Developer Portal "Manage message & content on Instagram" use case)
  2. Create a connect session and initiate nango.auth('instagram') from the frontend SDK
  3. Complete the Instagram OAuth consent screen
  4. Token exchange fails with the above error

Expected Behavior

Nango should send a POST request to Instagram's token endpoint (https://api.instagram.com/oauth/access_token) with client_id, client_secret, grant_type, redirect_uri, and code as form-encoded body parameters.

Environment

  • Nango Frontend SDK: @nangohq/frontend (latest via CDN)
  • Integration: instagram (built-in)
  • Instagram API: Instagram Basic Display / Instagram Login

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions