Im upgrading from v1 foursquare api to v2 which requires Oauth2.
Is it correct that to use the web server flow as recommened I should direct the user to : https://foursquare.com/oauth2/authenticate ?client_id=YOUR_CLIENT_ID &response_type=code &redirect_uri=YOUR_REGISTERED_REDIRECT_URI
Once the user is authenticated foursquare will redirect to : https://YOUR_REGISTERED_REDIRECT_URI/?code=CODE
Meaning I need to define an endpoint at https://YOUR_REGISTERED_REDIRECT_URI which will then make a request to
https://foursquare.com/oauth2/access_token ?client_id=YOUR_CLIENT_ID &client_secret=YOUR_CLIENT_SECRET &grant_type=authorization_code &redirect_uri=YOUR_REGISTERED_REDIRECT_URI &code=CODE
to get the actual token on my serverside.
How does this flow get the token back to the mobile device for usage?
Thanks for the help.