Hi,
The JWT settings are currently untouched.
if I remove the “id” then it automatically sets it to id=0.
PUT {{baseUrl}}/apptoken
content-type: {{contentType}}
Authorization: Bearer {{appToken}}
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiRGVmYXVsdCBBZG1pbiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2hhc2giOiI2MmQ0OTc1Ni05YjZlLTQxZGYtYjA4ZS1iOWVhZWI0NWQ3YTIiLCJzdWIiOiJQb3dlclNoZWxsVW5pdmVyc2FsIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiQWRtaW5pc3RyYXRvciIsIm5iZiI6MTYzMDM5MzQ3NiwiZXhwIjoxNjYxOTI5NDc2LCJpc3MiOiJJcm9ubWFuU29mdHdhcmUiLCJhdWQiOiJQb3dlclNoZWxsVW5pdmVyc2FsIn0.12FUuieJGSLHvvUuf6PCkSaK9faA4QMl8K1ovsnmwek",
"identity": {
"id": 1,
"name": "Default Admin",
"source": 0,
"role": null,
"roleName": null
},
"revoked": false,
"role": "Administrator",
"created": "2021-07-12T09:18:54.898+02:00",
"expiration": "2030-08-11T09:18:54.881+02:00",
"revokedDate": "0001-01-01T00:00:00",
"createdBy": {
"id": 1,
"name": null,
"source": 0,
"role": null,
"roleName": null
}
}
}
results in the following response:
HTTP/1.1 200 OK
Connection: close
Date: Tue, 31 Aug 2021 06:38:05 GMT
Content-Type: application/json; charset=utf-8
Server: Kestrel
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
{
"id": 0,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiRGVmYXVsdCBBZG1pbiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2hhc2giOiI2MmQ0OTc1Ni05YjZlLTQxZGYtYjA4ZS1iOWVhZWI0NWQ3YTIiLCJzdWIiOiJQb3dlclNoZWxsVW5pdmVyc2FsIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiQWRtaW5pc3RyYXRvciIsIm5iZiI6MTYzMDM5MzQ3NiwiZXhwIjoxNjYxOTI5NDc2LCJpc3MiOiJJcm9ubWFuU29mdHdhcmUiLCJhdWQiOiJQb3dlclNoZWxsVW5pdmVyc2FsIn0.12FUuieJGSLHvvUuf6PCkSaK9faA4QMl8K1ovsnmwek",
"identity": {
"id": 1,
"name": "Default Admin",
"source": 0,
"role": null,
"roleName": null
},
"revoked": false,
"role": "Administrator",
"created": "2021-07-12T09:18:54.898+02:00",
"expiration": "2030-08-11T09:18:54.881+02:00",
"revokedDate": "0001-01-01T00:00:00",
"createdBy": {
"id": 1,
"name": null,
"source": 0,
"role": null,
"roleName": null
}
}
If I try to use this newly created token
GET {{baseUrl}}/apptoken
content-type: {{contentType}}
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiRGVmYXVsdCBBZG1pbiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2hhc2giOiI2MmQ0OTc1Ni05YjZlLTQxZGYtYjA4ZS1iOWVhZWI0NWQ3YTIiLCJzdWIiOiJQb3dlclNoZWxsVW5pdmVyc2FsIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiQWRtaW5pc3RyYXRvciIsIm5iZiI6MTYzMDM5MzQ3NiwiZXhwIjoxNjYxOTI5NDc2LCJpc3MiOiJJcm9ubWFuU29mdHdhcmUiLCJhdWQiOiJQb3dlclNoZWxsVW5pdmVyc2FsIn0.12FUuieJGSLHvvUuf6PCkSaK9faA4QMl8K1ovsnmwek
all I get an unauthorized error:
HTTP/1.1 401 Unauthorized
Connection: close
Date: Tue, 31 Aug 2021 06:37:13 GMT
Server: Kestrel
Content-Length: 0
Location: http://localhost:5000/login?ReturnUrl=%2Fapi%2Fv1%2Fapptoken
WWW-Authenticate: Bearer error="invalid_token", Bearer error="invalid_token"