I'm reading the OAuth2 spec:
https://www.rfc-editor.org/rfc/rfc6749#section-4.4.2
Specially the section on client_credentials
grant type.
If the access token request is valid and authorized, the
authorization server issues an access token as described in Section
5.1.
A refresh token SHOULD NOT be included. If the request failed client authentication or is invalid, the authorization server
returns an error response as described in Section 5.2.
An example successful response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"example",
"expires_in":3600,
"example_parameter":"example_value"
}
`
I'm somewhat confused why an authorization server can return refresh_tokens for password
grant types but not for client_credentials
.
I'm guessing that it has something to do with the fact that the refresh_token can be exchanged for an access_token and because the client_credentials grant type does not require a username and password, in the event that your application keys and refresh_token is compromised revocation becomes much more difficult?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…