· 7 years ago · Nov 02, 2017, 07:40 PM
1content-type: application/x-www-form-urlencoded
2authorization: Basic dGVzdGp3dGNsaWVudGlkOlhZN2ttem9OemwxMDA=
3accept: */*
4
5{"username"="test", "password": "pw", "email": "test@example.com"}
6
7{
8 "error": "invalid_request",
9 "error_description": "Missing grant type"
10}
11
12$ curl testjwtclientid:XY7kmzoNzl100@localhost:8080/oauth/token -d grant_type=password -d username=john.doe -d password=pw -v
13* Trying 127.0.0.1...
14* Connected to localhost (127.0.0.1) port 8080 (#0)
15* Server auth using Basic with user 'testjwtclientid'
16> POST /oauth/token HTTP/1.1
17> Host: localhost:8080
18> Authorization: Basic dGVzdGp3dGNsaWVudGlkOlhZN2ttem9OemwxMDA=
19> User-Agent: curl/7.47.0
20> Accept: */*
21> Content-Length: 49
22> Content-Type: application/x-www-form-urlencoded
23>
24* upload completely sent off: 49 out of 49 bytes
25< HTTP/1.1 200
26< X-Content-Type-Options: nosniff
27< X-XSS-Protection: 1; mode=block
28< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
29< Pragma: no-cache
30< Expires: 0
31< X-Frame-Options: DENY
32< Cache-Control: no-store
33< Pragma: no-cache
34< Content-Type: application/json;charset=UTF-8
35< Transfer-Encoding: chunked
36< Date: Thu, 02 Nov 2017 19:21:29 GMT
37<
38* Connection #0 to host localhost left intact
39{"access_token":"<an-ugly-long-token>","token_type":"bearer","expires_in":43199,"scope":"read write","jti":"80e2b6af-d999-4fb6-a4cd-5e6ab9c3fcaa"}