Instagram API iOS client can log out of Instagram

I have an application where a user logs into Instagram using implicit auth with Oauth 2. Is there a way for the user to log out or re-register as a different user?

As of now, when I call the authorization URL after the user is logged in, the Safari browser starts, then returns to the application without displaying the login fields. I need Safari to display login fields and allow the user to enter uname and go through before the control is returned to the application.


source to share

3 answers

You can delete cookies from instagram as follows

       let cookieJar : NSHTTPCookieStorage = NSHTTPCookieStorage.sharedHTTPCookieStorage()
    for cookie in cookieJar.cookies! as [NSHTTPCookie]{
        NSLog("cookie.domain = %@", cookie.domain)

        if cookie.domain == "" ||
            cookie.domain == ""{





call the url for instagram registration ( ) and then call the url.

You can implement a logout button, so when the user logs out, it has to call the logout url and then wait for the delay, show the login button and then ask the user to log in.



Please delete your cookies, thats it. Happy Coding



All Articles