File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,9 +113,20 @@ Now you can register your ``AuthorizationCodeGrant`` with the extension::
113113 from authlib.oauth2.rfc7636 import CodeChallenge
114114 server.register_grant(MyAuthorizationCodeGrant, [CodeChallenge(required=True)])
115115
116- If ``required=True ``, code challenge is required for authorization code flow from public clients.
117- If ``required=False ``, it is optional, it will only valid the code challenge
118- when clients send these parameters.
116+ With ``required=True ``, public clients must use PKCE. The check happens at
117+ the token endpoint: a public client that sends no ``code_verifier `` gets an
118+ ``invalid_request `` error. The authorization endpoint does not reject a request
119+ without ``code_challenge ``, but the code it returns cannot be exchanged.
120+
121+ With ``required=False ``, PKCE is optional for all clients.
122+
123+ In both modes:
124+
125+ * If the authorization request contained a ``code_challenge ``, the token
126+ request must contain a matching ``code_verifier ``.
127+ * If the authorization request contained no ``code_challenge ``, a token
128+ request with a ``code_verifier `` is rejected.
129+ * Confidential clients may use PKCE, but are not required to.
119130
120131Using ``code_challenge `` in Client
121132----------------------------------
You can’t perform that action at this time.
0 commit comments