[GH-ISSUE #245] 404 on Instagram redirect #141

Closed
opened 2026-03-03 16:46:02 +03:00 by kerem · 1 comment
Owner

Originally created by @cameronbarker on GitHub (Jun 26, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/245

After authenticating an Instagram account, the redirect goes to a Instagram generated 404 page. Was something changed in the Instagram API update that broke this flow?

This is what the URL looks like:
https://www.instagram.com/oauth/authorize?client_id=*******&redirect_uri=linksit://oauth-callback/instagram&response_type=code&scope=basic&state=INSTAGRAM

This is the implementation in my code:

 let oauthswift = OAuth2Swift(
            consumerKey:    "******",
            consumerSecret: "*****",
            authorizeUrl:   "https://api.instagram.com/oauth/authorize",
            responseType:   "code"
        )
        oauthswift.authorize_url_handler = SafariURLHandler(viewController: parentView)

        oauthswift.authorizeWithCallbackURL(
            NSURL(string: "linksit://oauth-callback/instagram")!,
            scope: "basic", state:"INSTAGRAM",
            success: { credential, response, parameters in
                completion(access_token: credential.oauth_token)
            },
            failure: { error in
                print(error.localizedDescription)
            }
        )
  • OS targeted (with version): 9.2
  • OAuth provider: Instagram
  • OAuthSwift version: pod 'OAuthSwift', '~> 0.5.0'
Originally created by @cameronbarker on GitHub (Jun 26, 2016). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/245 After authenticating an Instagram account, the redirect goes to a Instagram generated 404 page. Was something changed in the Instagram API update that broke this flow? This is what the URL looks like: https://www.instagram.com/oauth/authorize?client_id=*******&redirect_uri=linksit://oauth-callback/instagram&response_type=code&scope=basic&state=INSTAGRAM This is the implementation in my code: ``` let oauthswift = OAuth2Swift( consumerKey: "******", consumerSecret: "*****", authorizeUrl: "https://api.instagram.com/oauth/authorize", responseType: "code" ) oauthswift.authorize_url_handler = SafariURLHandler(viewController: parentView) oauthswift.authorizeWithCallbackURL( NSURL(string: "linksit://oauth-callback/instagram")!, scope: "basic", state:"INSTAGRAM", success: { credential, response, parameters in completion(access_token: credential.oauth_token) }, failure: { error in print(error.localizedDescription) } ) ``` - **OS targeted (with version):** 9.2 - **OAuth provider:** Instagram - **OAuthSwift version:** pod 'OAuthSwift', '~> 0.5.0'
kerem closed this issue 2026-03-03 16:46:03 +03:00
Author
Owner

@cameronbarker commented on GitHub (Jul 2, 2016):

Looks like it was because I was asking for a responseType of code not token.

<!-- gh-comment-id:230073934 --> @cameronbarker commented on GitHub (Jul 2, 2016): Looks like it was because I was asking for a responseType of code not token.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#141
No description provided.