Test - ps1-ch/test GitHub Wiki
$ curl -s -u user:password http://localhost:8080/api/user|jq
{
"authorities": [],
"details": {
"remoteAddress": "127.0.0.1",
"sessionId": null
},
"authenticated": true,
"principal": {
"password": null,
"username": "user",
"authorities": [],
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"enabled": true
},
"credentials": null,
"name": "user"
}
Response Headers
$ curl -D - -s -u user:password -o /dev/null http://localhost:8080/api/user
HTTP/1.1 200
Set-Cookie: JSESSIONID=31E38CC714D03056C810CBD7E231EF5D; Path=/; HttpOnly
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 27 Nov 2020 22:11:12 GMT
JPA Authentication
$ curl -s -u user:password http://localhost:8080/api/user|jq
{
"authorities": [
{
"authority": "ROLE_USER"
}
],
"details": {
"remoteAddress": "127.0.0.1",
"sessionId": null
},
"authenticated": true,
"principal": {
"username": "user",
"password": "$2a$10$8uWwUAEEZ66bcQKzUN6HfeYMMmYCLmTrsHhzmJfDTCphBsiv/bGEe",
"credentialsNonExpired": true,
"accountNonLocked": true,
"enabled": true,
"accountNonExpired": true,
"authorities": [
{
"authority": "ROLE_USER"
}
]
},
"credentials": null,
"name": "user"
}