Device authorization (RFC 8628)
curl --request POST \
--url https://prod-auth.tktchurch.com/oauth/device_authorization \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>"
}
'import Foundation
let parameters = ["client_id": "<string>"] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://prod-auth.tktchurch.com/oauth/device_authorization")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({client_id: '<string>'})
};
fetch('https://prod-auth.tktchurch.com/oauth/device_authorization', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod-auth.tktchurch.com/oauth/device_authorization"
payload = { "client_id": "<string>" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"device_code": "RjYxNzAtY2xJLWtleS1kZXY",
"user_code": "WDJB-PTNN",
"verification_uri": "https://accounts.tktchurch.com/device",
"verification_uri_complete": "https://accounts.tktchurch.com/device?user_code=WDJB-PTNN",
"expires_in": 1800,
"interval": 5
}{
"error": "invalid_request",
"error_description": "Redirect URI not registered for this client"
}{
"error": "invalid_token",
"error_description": "Access token is invalid or malformed"
}Device authorization (RFC 8628)
Returns device_code, user_code and verification URIs.
POST
/
oauth
/
device_authorization
Device authorization (RFC 8628)
curl --request POST \
--url https://prod-auth.tktchurch.com/oauth/device_authorization \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>"
}
'import Foundation
let parameters = ["client_id": "<string>"] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://prod-auth.tktchurch.com/oauth/device_authorization")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({client_id: '<string>'})
};
fetch('https://prod-auth.tktchurch.com/oauth/device_authorization', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod-auth.tktchurch.com/oauth/device_authorization"
payload = { "client_id": "<string>" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"device_code": "RjYxNzAtY2xJLWtleS1kZXY",
"user_code": "WDJB-PTNN",
"verification_uri": "https://accounts.tktchurch.com/device",
"verification_uri_complete": "https://accounts.tktchurch.com/device?user_code=WDJB-PTNN",
"expires_in": 1800,
"interval": 5
}{
"error": "invalid_request",
"error_description": "Redirect URI not registered for this client"
}{
"error": "invalid_token",
"error_description": "Access token is invalid or malformed"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
