인가 엔드포인트
curl --request GET \
--url https://api.headlesscommerce.io/v1/oauth/authorizeimport requests
url = "https://api.headlesscommerce.io/v1/oauth/authorize"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.headlesscommerce.io/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.headlesscommerce.io/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",
]);
$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.headlesscommerce.io/v1/oauth/authorize"
req, _ := http.NewRequest("GET", url, nil)
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.headlesscommerce.io/v1/oauth/authorize")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.headlesscommerce.io/v1/oauth/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body<string>{
"error": "<string>",
"error_description": "<string>"
}OAuth 2.1
인가 엔드포인트
PKCE를 사용한 OAuth 2.1 인가 코드 플로우를 시작합니다.
로그인 및 동의 폼을 렌더링합니다. 사용자가 인증하고 스토어를 선택하면
브라우저가 redirect_uri로 인가 code와 state를 포함하여 리다이렉트됩니다.
GET
/
oauth
/
authorize
인가 엔드포인트
curl --request GET \
--url https://api.headlesscommerce.io/v1/oauth/authorizeimport requests
url = "https://api.headlesscommerce.io/v1/oauth/authorize"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.headlesscommerce.io/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.headlesscommerce.io/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",
]);
$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.headlesscommerce.io/v1/oauth/authorize"
req, _ := http.NewRequest("GET", url, nil)
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.headlesscommerce.io/v1/oauth/authorize")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.headlesscommerce.io/v1/oauth/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body<string>{
"error": "<string>",
"error_description": "<string>"
}쿼리 매개변수
/oauth/register에서 발급받은 OAuth 클라이언트 ID
등록된 리다이렉트 URI
code여야 합니다
사용 가능한 옵션:
code 공백으로 구분된 스코프 (예: products:read orders:write)
리다이렉트에서 반환되는 CSRF 방지 토큰
PKCE 코드 챌린지 (SHA-256 해시의 Base64-URL)
사용 가능한 옵션:
S256 응답
HTML 로그인/동의 폼
The response is of type string.