文档中心 > Developing documents(已废弃)

User Authorization - redirect_uri

更新时间:2018/03/28 访问次数:1107

Overview

During the user authorization process, to obtain the code, need to send a “redirect_uri” to the server. It’s a URL where you receive the code. After user authorization, the client browser will redirect to this URL with parameter code, thus you can get the code. For example, the “redirect_uri” parameter sent to is "http://www.oauth.net:8080/token.htm", the final redirect URL will be something like this: http://www.oauth.net:8080/token.htm?code=0***x.

The domain name or top-level domain of “redirect_uri” needs to be consistent the callback URL defined in console

image

Callback URL in test environment

Before you release you application to production, you may not have the callback URL available in Internet. Then how can we get the code from callback URL?

One way to achieve this is to change your local host binding (in hosts file). If you check the image above, you will find oauth.net. Actually this is not owned by me, it’s the official side of oauth protocol. But in my local host binding, I’ve bound this domain (www.oauth.net) to 127.0.0.1. So even I set the redirect_uri to http://www.oauth.net:8080/token.htm, it will eventually redirect to the page (token.htm) on my local server.

FAQ

关于此文档暂时还没有FAQ
返回
顶部