curl --request GET \
--url https://api.example.com/v1/oauth/authorize \
--cookie gproxy_session=import requests
url = "https://api.example.com/v1/oauth/authorize"
headers = {"cookie": "gproxy_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'gproxy_session='}};
fetch('https://api.example.com/v1/oauth/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/oauth/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "gproxy_session=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/oauth/authorize"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "gproxy_session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/oauth/authorize")
.header("cookie", "gproxy_session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/oauth/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'gproxy_session='
response = http.request(request)
puts response.read_body{
"client_id": "<string>",
"client_name": "<string>",
"redirect_uri": "<string>",
"scopes": [
"<string>"
],
"state": "<string>",
"user_id": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}GET /v1/oauth/authorize
Accept: text/html redirects to consent without authentication. JSON details require a console session or management API key.
curl --request GET \
--url https://api.example.com/v1/oauth/authorize \
--cookie gproxy_session=import requests
url = "https://api.example.com/v1/oauth/authorize"
headers = {"cookie": "gproxy_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'gproxy_session='}};
fetch('https://api.example.com/v1/oauth/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/oauth/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "gproxy_session=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/oauth/authorize"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "gproxy_session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/oauth/authorize")
.header("cookie", "gproxy_session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/oauth/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'gproxy_session='
response = http.request(request)
puts response.read_body{
"client_id": "<string>",
"client_name": "<string>",
"redirect_uri": "<string>",
"scopes": [
"<string>"
],
"state": "<string>",
"user_id": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}授权
查询参数
The base64url SHA-256 of the client's verifier (RFC 7636 §4.2).
Must be S256.
Matched exactly against oauth_clients.redirect_uris.
Must be code. This issuer has no implicit and no hybrid flow.
Space-delimited, per RFC 6749 §3.3. Empty asks for no scope.
Opaque client value, echoed back untouched on both outcomes. It is the client's CSRF defence and this issuer never interprets it.
响应
Success
What a consent screen renders, once the request has been found valid.
Returned by Issuer::authorize_details [blocked],
which validates everything an approval would validate. A screen built from
this can therefore show the user a decision that will actually be honoured
rather than one that fails after they take it.
oauth_clients.name, which is what the user recognises. The id is a
string a binary was compiled with and means nothing to them.
The exact registered redirect URI the code would be delivered to.
The requested scopes, already split on whitespace and deduplicated.
The user a consent would bind the grant to.