Is it possible to add user specific properties (next to userName, fullName, ID) to the directory.currentUser()
object?
Result: directory.currentUser()
{
"result": {
"userName": "jsmith",
"fullName": "John Smith",
"ID": "12F169764253481E89F0E4EA8C1D791A"
}
}
http://livedoc.wakanda.org/HTTP-REST/Authenticating-Users/directorycurrentUser.303-815875.en.html
No, you can't. However don't consider it as a drawback:
I suggest you to keep the
directory
as the authentication service of your application and store your user profile information on another entity (calleduserProfile
,userInfo
,client
, ...).This entity should be created just after the signup / first login of the user. It should have an attribute (for example
auth
) with the same value as theID
retrieved from thedirectory.currentUser
function.This way when the user makes a login, you fetch his profile searching the entity
and consume / update his information there.
The solution is very effective if you want to keep separated your authentication system and your model. You will maintain the flexibility to rely on a different authentication system or make a dedicated micro-service later.