隐式模式
最后更新于
{
"kty": "RSA",
"e": "AQAB",
"n": "1GBBv-QOtbNIvgJZqvW2nvIrNx6-YNKJAD3L3WspAcx1y-RYctI2RBb4k4GN0du8AH2UUf8wBywONHplYAw1djkWAztHgj4cc_WxqKvD1t5bNNjRW7I5EPA9ZEkFblIAxZVwhOPK5H8KLgiVaD7y9fPEks6sVhu2VUQKC0Qr85-0WJVzmXP3QH_1yLn1qRpkJtjCW1I4DPsB0TrQC6WBMy99Io8zECraueLrJFApuRx1H_MwgDwnt4VlYuaoqU17TyBUQWO077mUB-FFI-s0jALuPAUuNWHFFogTq2cbydaSfPcWQPjylYcLcIt-bBBdedLqsTk_0nTXPqREMFwexw",
"alg": "RS256",
"use": "sig",
"kid": "AUQR2TFiVexgvm0j0PrbZ3ofEz9R2eG7qvEJP9Ua2f0"
}https://dev-5kzk7gzc.us.auth0.com/.well-known/openid-configuration# 授权地址,与授权码模式类似
https://xxxx.authing.cn/oidc/auth?
# 客户端ID,即应用ID
client_id=644512df9e360e3f7a40e1e4&
# 重定向URL,授权完成后,跳转的页面
redirect_uri=https://example.com&
scope=openid%20profile&
# 授权类型,注意与授权码模式不同,非常重要
response_type=id_token%20token&
state=6223573295&nonce=1831289https://example.com/#
# 授权令牌
access_token=part1.part2.part3&
# 令牌类型,Bearer
token_type=Bearer&
# 令牌过期时间
expires_in=1209600&
scope=openid%20profile&
# id令牌
id_token=part1.part2.part3&
state=6223573295curl --location --request POST 'https://xxxx.authing.cn/api/v3/signin' \
# 用户池ID
--header 'x-authing-userpool-id: 64452248da5930463241789f' \
# 应用ID
--header 'x-authing-app-id: 644513df9e260e3f7a10e3e4' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Connection: keep-alive' \
--data-raw '{
"connection":"PASSWORD", # 登录模式
"passwordPayload":{
"password":"123456", # 密码
"phone":"18189156130" # 账户
}
}'{
"statusCode": 200,
"message": "",
"data": {
"scope": "profile openid tenant_id",
"token_type": "Bearer",
"access_token": "part1.part2.part3", // 保存使用
"expires_in": 1209600,
"id_token": "part1.part2.part3"
}
}query MyQuery($uid: String! @fromClaim(name: USERID)) {
todo_findManyTodo(where: {uid: {equals: $uid}}) {
id
title
}
}curl -X GET "http://localhost:9991/operations/FromClaim" \
# 添加以下请求头
--header 'Authorization: Bearer <access_token>' \
-H "accept: application/json" \{
"data": {
"todo_findUniqueClaim": {
"email": "[email protected]",
"emailVerified": false,
"location": "",
"name": "[email protected]",
"nickname": "test",
"provider": "auth0",
"roles": null,
"userId": "auth0|637b4ab0c0cb508c49de7cf3"
}
}
}# Authing 授权端点
https://xxx.authing.cn/oidc/auth?
# 客户端ID,用于区分是哪个应用
client_id=xxxx&
# 重定向URL,当前客户端的前端页面(不是Fireboom的地址)
redirect_uri=[https://example.com]&
# 授权范围
scope=openid profile&
# 授权类型,这是与授权码模式的区别之处
response_type=id_token token&
state=xxxhttps://example.com/#
# 授权令牌
access_token=part1.part2.part3&
# 令牌类型,Bearer
token_type=Bearer&
# 令牌过期时间
expires_in=1209600&
scope=openid%20profile&
# id令牌
id_token=part1.part2.part3&
state=6223573295curl --location --request GET 'https://xxx.authing.cn/oidc/me' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: */*' \{
"name": "anson",
"given_name": null,
"middle_name": null,
"family_name": null,
"nickname": "18189156130",
"preferred_username": "18189156130",
"profile": null,
"picture": null,
"website": null,
"birthdate": "2023-06-29T12:47:00.173Z",
"gender": "male",
"zoneinfo": null,
"locale": null,
"updated_at": "2023-08-09T09:07:37.988Z",
"tenant_id": "",
"sub": "645b472d9df8868fe52074d6"
}Authorization: Bearer <access_token>