Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7698527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:15:46+00:00 2026-05-31T22:15:46+00:00

I have set up the OAuth request following the documentation for a Non-Google Service

  • 0

I have set up the OAuth request following the documentation for a “Non-Google Service” and I get 90% of this working. The app brings up a web view where I can login to Instagram using the correct access token for my app and accept the scope request but once I accept the request I get the following error:

Error Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed.
(com.google.HTTPStatus error 400.)" UserInfo=0x6b7ab00 {data=<7b22636f 6465223a 20343030 2c202265 72726f72 5f747970 65223a20 224f4175 74684578 63657074 696f6e22 2c202265 72726f72 5f6d6573 73616765 223a2022 596f7520 6d757374 20696e63 6c756465 20612076 616c6964 20636c69 656e745f 69642c20 20202020 20202020 20202020 72657370 6f6e7365 5f747970 652c2061 6e642072 65646972 6563745f 75726920 70617261 6d657465 7273227d>}
Error data:
{
    code = 400;
    "error_message" = "You must include a valid client_id, response_type, and redirect_uri parameters";
    "error_type" = OAuthException;
}

It seems like the controller is attempting to complete the OAuth transaction against google.com instead of api.instagram.com.

Here is my objective-c code to set up and invoke the controller:

static NSString *const kKeychainItemName = @"Instagram OAuth2";
static NSString *const kClientID = @"xxxxxxxxx"; // Removed for security
static NSString *const kClientSecret = @"xxxxxxxxx"; // Removed for security

static NSString *const authURLString = @"https://api.instagram.com/oauth/authorize/";
static NSString *const tokenURLString = @"https://api.instagram.com/oauth/authorize/";
static NSString *const redirectURI = @"http://google.com/NeverGonnaFindMe/";

...

NSURL *tokenURL = [NSURL URLWithString:tokenURLString];

// Set up the OAuth request
GTMOAuth2Authentication *auth = [GTMOAuth2Authentication
            authenticationWithServiceProvider:@"Instagram API"
            tokenURL:tokenURL
            redirectURI:redirectURI
            clientID:kClientID
            clientSecret:kClientSecret
         ];

// Specify the appropriate scope string, if any, according to the service's API documentation
auth.scope = @"basic likes comments relationships";

NSURL *authURL = [NSURL URLWithString:authURLString];

// Display the authentication view
GTMOAuth2ViewControllerTouch *viewController = [[GTMOAuth2ViewControllerTouch alloc]
                      initWithAuthentication:auth
                      authorizationURL:authURL
                      keychainItemName:kKeychainItemName
                      delegate:self
                      finishedSelector:@selector(viewController:finishedWithAuth:error:)                                                     
                    ];
// Capture the Cookie to delete later
viewController.browserCookiesURL = [NSURL URLWithString:@"instagram.com/"];

// Now push our sign-in view
[[self navigationController] pushViewController:viewController animated:YES];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:15:47+00:00Added an answer on May 31, 2026 at 10:15 pm

    Solved

    https://groups.google.com/forum/?fromgroups#!topic/instagram-api-developers/SUYPX7ZQHhs

    It was the token URL that was incorrect. Correct token URL is: https://api.instagram.com/oauth/access_token/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to get TripIt OAuth authentication working, but I find the documentation to
We have set up a system where notifications get sent to a user with
I have an application that uses OAuth whose logic is something like this: If
Any way to test OAuth integration to google without having to have a port
I'm trying to get OAuth through SoundCloud set up, but I'm having tremendous trouble.
I have to integrate linkedIn sharing in my app, I will be using this
I'm trying to configure OAuth into my iPhone app to connect to another web
I'm pretty much following this tutorial http://net.tutsplus.com/tutorials/php/how-to-authenticate-users-with-twitter-oauth/ and i have everything working i can
My app is set up so that if a user signs in with Oauth
How to set multiple Content-Types? I have to pass an array to request body.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.