I am trying to use the Instagram OAuth using the developer documentation at
https://www.instagram.com/developer/authentication/.
Step 1 and 2 a
I solved this by creating a service on the backend/server side that authorised the user.
My backend API is a ruby on rails app. Here is a code snippet to understand.
def token
@response = Instagram.get_access_token(params[:code], redirect_uri: mobile_token_url)
instagram_user = InstagramUserCreator.new(user_params)
if instagram_user.find_or_create
redirect_to "taddarmobileapp://?token=#{instagram_user.user.token}"
else
redirect_to 'taddarmobileapp://'
end
end
I just store the token on the phone and use it to authorise the user to my backend API.