cURL
curl --request GET \
--url https://prod-auth.tktchurch.com/oauth/userinfo \
--header 'Authorization: Bearer <token>'import Foundation
var request = URLRequest(url: URL(string: "https://prod-auth.tktchurch.com/oauth/userinfo")!)
request.setValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")
let (data, response) = try await URLSession.shared.data(for: request)
// Requires the openid scope — otherwise 401 insufficient_scope.
guard (response as? HTTPURLResponse)?.statusCode == 200 else { throw AuthError.unauthorized }
let info = try JSONDecoder().decode(UserInfo.self, from: data)
print(info.email)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://prod-auth.tktchurch.com/oauth/userinfo', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod-auth.tktchurch.com/oauth/userinfo"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"sub": "b3e2f1a4-9c8d-4e7f-a6b5-0123456789ab",
"email": "[email protected]",
"email_verified": true,
"name": "Amina Diallo",
"preferred_username": "amina",
"org_id": "org_e02bwG5bFJQ12OBHvxEskILv"
}{
"error": "invalid_token",
"error_description": "Access token is invalid or malformed"
}UserInfo (OIDC Core 5.3)
Claims filtered by granted scopes. Requires the openid scope — otherwise 401 insufficient_scope.
GET
/
oauth
/
userinfo
cURL
curl --request GET \
--url https://prod-auth.tktchurch.com/oauth/userinfo \
--header 'Authorization: Bearer <token>'import Foundation
var request = URLRequest(url: URL(string: "https://prod-auth.tktchurch.com/oauth/userinfo")!)
request.setValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")
let (data, response) = try await URLSession.shared.data(for: request)
// Requires the openid scope — otherwise 401 insufficient_scope.
guard (response as? HTTPURLResponse)?.statusCode == 200 else { throw AuthError.unauthorized }
let info = try JSONDecoder().decode(UserInfo.self, from: data)
print(info.email)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://prod-auth.tktchurch.com/oauth/userinfo', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod-auth.tktchurch.com/oauth/userinfo"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"sub": "b3e2f1a4-9c8d-4e7f-a6b5-0123456789ab",
"email": "[email protected]",
"email_verified": true,
"name": "Amina Diallo",
"preferred_username": "amina",
"org_id": "org_e02bwG5bFJQ12OBHvxEskILv"
}{
"error": "invalid_token",
"error_description": "Access token is invalid or malformed"
}