I have configured an email adress for the users in the *.yaml files for the local users which I want to retrieve from the currently logged in user in dataservices.
username: admin
password: admin
authorities:
- guest
- admin
- systemAdmin
firstname: Ad
lastname: min
email: admin@example.com
In order to get the current user, i found the 2 ways:
com.mgmtp.a12.uaa.authorization.UserUtil.resolveCurrentUser();
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
ExtendedUser user = (ExtendedUser) authentication.getPrincipal();
Both of which return the configured local user but without firstname, lastname nor email address (everything is null)
Also when logging in via /user/local/login, the user returned does not contain this information:
{
"username": "admin",
"eMail": null,
"firstName": null,
"lastName": null,
"displayName": "admin",
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"enabled": true,
"roles": [
Is it possible, to read out the email adress (Which according to the documentation is not an additional property) of the user in the code & if so, how?
Thanks!
Sebastian