For some Integration tests with LOCAL authentication type I would like to also use a AuthenticationRestClient that acts as an anonymous user and call currentUser() for example. However when using the UaaRestClientAutoconfiguration with property mgm.uaa.authentication.client.rest.authentication-configuration.user-name having an empty string as value a login request is always approached but receives an Unauthorized on the client side.
When trying to do same with the browser I receive a response, for example in my case visiting http://localhost:9090/api/uaa-authentication/currentUser returns:
{
"username": "anonymous",
"eMail": null,
"firstName": null,
"lastName": null,
"displayName": "anonymous",
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"enabled": true,
"roles": [{
"name": "guest",
"description": null,
"accessRights": [{
"name": "MODEL_READ",
"description": null
}, {
"name": "DOCUMENT_READ",
"description": null
}, {
"name": "COSMO",
"description": null
}
]
}
]
}
I would like to get a similiar response with the AuthenticationRestClient when invoking currentUser(). How do I do that in a spring boot environment?