附录 A. 扩充巴科斯范式(ABNF)语法
本节使用 [RFC5234] 的符号,描述了本规范中定义的各元素的扩充巴科斯范式(ABNF)语法。以下 ABNF 使用 Unicode 码位 [W3C.REC-xml-20081126] 定义;这些字符通常使用 UTF-8 编码。各元素根据定义顺序进行展示。
以下某些定义使用了 [RFC3986] 中的“URI-reference”定义。
以下某些定义中使用了这些通用定义:
VSCHAR = %x20-7E
NQCHAR = %x21 / %x23-5B / %x5D-7E
NQSCHAR = %x20-21 / %x23-5B / %x5D-7EA.1. “client_id”语法
第 2.4.1 节定义了元素“client_id”:
client-id = *VSCHARA.2. “client_secret”语法
第 2.4.1 节定义了元素“client_secret”:
client-secret = *VSCHARA.3. “response_type”语法
第 4.1.1 节和第 6.4 节定义了元素“response_type”:
response-type = response-name *( SP response-name )
response-name = 1*response-char
response-char = "_" / DIGIT / ALPHAA.4. “scope”语法
第 1.4.1 节定义了元素“scope”:
scope = scope-token *( SP scope-token )
scope-token = 1*NQCHARA.5. “state”语法
第 4.1.1 节、第 4.1.2 节和第 4.1.2.1 节定义了元素“state”:
state = 1*VSCHARA.6. “redirect_uri”语法
第 4.1.1 节和第 4.1.3 节定义了元素“redirect_uri”:
redirect-uri = URI-referenceA.7. “error”语法
第 4.1.2.1 节、第 3.2.4 节、第 7.2 节和第 8.5 节定义了元素“error”:
error = 1*NQSCHARA.8. “error_description”语法
第 4.1.2.1 节、第 3.2.4 节和第 5.3 节定义了元素“error_description”:
error-description = 1*NQSCHARA.9. “error_uri”语法
第 4.1.2.1 节、第 3.2.4 节和第 7.2 节定义了元素“error_uri”:
error-uri = URI-referenceA.10. “grant_type”语法
第 3.2.2 节定义了元素“grant_type”:
grant-type = grant-name / URI-reference
grant-name = 1*name-char
name-char = "-" / "." / "_" / DIGIT / ALPHAA.11. “code”语法
第 4.1.3 节定义了元素“code”:
code = 1*VSCHARA.12. “access_token”语法
第 3.2.3 节定义了元素“access_token”:
access-token = 1*VSCHARA.13. “token_type”语法
第 3.2.3 节和第 6.1 节定义了元素“token_type”:
token-type = type-name / URI-reference
type-name = 1*name-char
name-char = "-" / "." / "_" / DIGIT / ALPHAA.14. “expires_in”语法
第 3.2.3 节定义了元素“expires_in”:
expires-in = 1*DIGITA.15. “refresh_token”语法
第 3.2.3 节和第 4.3 节定义了元素“refresh_token”:
refresh-token = 1*VSCHARA.16. 端点参数语法
第 6.2 节定义了新的端点参数的语法:
param-name = 1*name-char
name-char = "-" / "." / "_" / DIGIT / ALPHAA.17. “code_verifier”语法
下面是 code_verifier 的 ABNF。
code-verifier = 43*128unreserved
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
ALPHA = %x41-5A / %x61-7A
DIGIT = %x30-39A.18. “code_challenge”语法
下面是 code_challenge 的 ABNF。
code-challenge = 43*128unreserved
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
ALPHA = %x41-5A / %x61-7A
DIGIT = %x30-39