Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6XzpJxZ25cDyuw1Uk
18 lines
698 B
Plaintext
18 lines
698 B
Plaintext
$ curl -X POST /api/auth/login (alice)
|
|
{"access_token":"eyJraWQiOiJMeX...","refresh_token":"FeHO52BY0danWV...","token_type":"Bearer","expires_in":300}
|
|
|
|
$ curl /api/me (Bearer access token)
|
|
{"sub":"alice","sid":"c9ddb06a..."}
|
|
HTTP 200
|
|
|
|
$ curl -X POST /api/auth/refresh (token A)
|
|
{"access_token":"eyJraWQiOiJMeX...","refresh_token":"zgB_rx1Kaqu_AZ...","token_type":"Bearer","expires_in":300}
|
|
|
|
$ curl -X POST /api/auth/refresh (token A again: the replay)
|
|
{"error":"invalid_grant","error_description":"The refresh token is not valid"}
|
|
HTTP 401
|
|
|
|
$ curl -X POST /api/auth/refresh (token B, the innocent holder)
|
|
{"error":"invalid_grant","error_description":"The refresh token is not valid"}
|
|
HTTP 401
|