snowflakekiller
snowflakekiller

Reputation: 3568

pass parameter to uber callback URL Oauth2

I am new to Oauth2,

I'm trying to make an api request for an authorization code from uber. As part of this authorization request, I need to send my user to an uber Oauth page with my client ID, scope and desired response type in params. When uber recieves this and the user authorizes, it redirects to the redirect url I specify on the app setup page on Uber. How do I pass a parameter from my page that will be sent back to the redirect page? say for example a page ID I would like to return the user to?

window.location = "https://login.uber.com/oauth/v2/authorize?response_type=code&client_id=h7bb35FsVvROsrlBO_BWPmKI9osk-7ra&scope=request&page_id=111"

Upvotes: 3

Views: 1639

Answers (1)

Hans Z.
Hans Z.

Reputation: 53977

If Uber implements OAuth 2.0 correctly, you should be able to pass state information in a parameter called state that will be returned with the authorization response (i.e. redirect) to the callback URL.

It is advised though to make that state a reference to something you keep in your application (client or server side) and bind that to the browser to prevent CSRF.

Upvotes: 3

Related Questions