简体   繁体   中英

Java implementation of Instagram - Obtaining an OAuth token

I'm currently trying to implement the popular service Instagram in a personal project in Java. The API uses OAuth tokens for authentication, and requires users to login and authorize before I can get a user-specific access token. My question is, is it possible to browse to the Instagram login page from inside Java, then follow the redirect to get the access token?

I've tried POSTing to the login page, but it throws a 401 whenever I try.

If anyone could point me in the right direction, I would be eternally grateful.

Regards

I think your approach is not very pragmatic. You have to construct the correct url(s) and give it(them) to the user in someway. Try the steps enumerated here from your command line (eg, curl) and be sure to have all the corresponding values.

...then try the same from your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM