Using ktor for client side.
fun main() {
runBlocking {
val client = HttpClient(Java) {
install(ContentNegotiation) {
json(Json {
prettyPrint = true
isLenient = true
ignoreUnknownKeys = true
})
}
}
val response: User = client.get(UserHttpRoutes.GET_CURRENT_AUTH_USER) {
headers {
append(HttpHeaders.Authorization, "Bearer zI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcm5hbWUiOiJhdHVueTAiLCJlbWFpbCI6ImF0dW55MEBzb2h1LmNvbSIsImZpcnN0TmFtZSI6IlRlcnJ5IiwibGFzdE5hbWUiOiJNZWRodXJzdCIsImdlbmRlciI6Im1hbGUiLCJpbWFnZSI6Imh0dHBzOi8vcm9ib2hhc2gub3JnL1RlcnJ5LnBuZz9zZXQ9c2V0NCIsImlhdCI6MTcxNjA1NzY5NSwiZXhwIjoxNzE2MDYxMjk1fQ.1LWhpQm_nQL1TsgDfVhN2P4dwDijSIqMN_E5_P-mh7w")
}
}.body()
println(response)
}
}
This token was returned while signing in with that user. A json with empty fields is returned. Same happens when i damage the token, just deleting any word.