The problem of redirect_uri in Oauth2.0

after reading the relevant knowledge of Oauth2.0, I want to develop an authentication server by myself. Now there is such a question.
is the redirect_uri requested by the client an interface address or a page address of a client?
if it is a page address, does the authentication server jump to this redirect address when it returns the authorization code? After the jump, the redirected page will immediately take code to the server to request access_token? Is my understanding correct?

Supplementary Code:
Port 3000 represents the third-party client, and 3001 is the authentication server
step 1: the browser clicks to log in and jumps to the login page of the authentication server (3000 jumps to 3001)

$("-sharploginBtn").click(function(){
        window.location.href="http://127.0.0.1:3001/loginPage.html?response_type=code&client_id=test001&redirect_uri=http://127.0.0.1:3000/api/callback";
    })

step 2: enter the username and password and click to log in to get the authorization code
(request / oauth2/authorize on the login page on 3001 to get the authorization code)

// 3001
function userLogin() {
            let userName = $("-sharpusername").val();
            let userPass = $("-sharpuserpass").val();
            $.ajax({
                url: "127.0.0.1:3001/oauth2/authorize",
                methods: "GET",
                data: {
                    "signName": userName,
                    "signCode": userPass,
                    "response_type": getUrlParam("response_type"),
                    "client_id": getUrlParam("client_id"),
                    "redirect_uri": getUrlParam("redirect_uri")
                },
                success: function (res) {
                    console.log("success", res);
                },
                error: function (err) {
                    console.log("error:", err)
                }
            });
        }
        //url
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }

Authentication server / oauth2/authorize interface

// 3001(30013000redirect_uri)
App.use("/oauth2/authorize", function(req,res){
    // 
    var code = "123";
    var redirect_uri = req.query.redirect_uri;
    res.redirect(redirect_uri+"&code="+code)  //3000
});

step 3: the redirect_uri API gets the authorization code and then requests access_token from the authentication server (3000 requests 3001 for token)

// 3000redirect_uri
App.use("/api/callback", function(req,res){
    var code = req.query.code;
    var redirect_uri = "127.0.0.1:3000/api/callback";
    $.ajax({
        url: "127.0.0.1:3001/oauth2/get_token",
        methods: "GET",
        data: {
            "code": code,
            "redirect_uri": redirect_uri,
            "grant_type":"authorization_code"
        },
        success: function (res) {
            console.log("success", res);
            // 
        },
        error: function (err) {
            console.log("error:", err)
        }
    })
});
Mar.24,2021

is the redirect_uri requested by the client an interface address or a page address of a client?

is generally the page address and the page address of the server (or the interface whose return data is html ), and executes its own logic (such as determining whether it is called back by the authentication server or camouflaged). When you jump to the authentication server, everything is out of your control. After the authentication is successful, you need to return to your website and let the user continue the following process.

I don't understand what your third step means.

Menu