You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Please consider rewrite or update javascript adapter docs to add how to get the current user
#13610
I'm currently working to revamp my authentication process on the front-end to move from 'login-required' to 'check-sso'. In the same time i moved to TS which brings a few more informations in current documentation (JS).
I write this discussion because i'm surprise there is no information about how to get the current user information. I believe this is an essential feature that should be documented even more when there is so much possibility. (From my point of view) This is all the places where you can find usefull informations about the user :
idTokenParsed : object
tokenParsed : object
realmAccess : object
resourceAccess : object
loadUserProfile : function
loadUserInfo : function
Typescript types indicates that the latest options shouldn't be used so i won't consider it as an option :
idTokenParsed :
✔️ user id
✔️ user informations (such as name, email, etc...)
✔️ user groups
✔️ user roles by using realmAccess or/and resourceAccess
❌ user attributes
tokenParsed :
✔️ user id
✔️ user informations (such as name, email, etc...)
✔️ user groups
✔️ user roles
❌ user attributes
loadUserProfile :
✔️ user id
✔️ user informations (such as name, email, etc...)
❌ user groups
✔️ user roles by using realmAccess or/and resourceAccess
✔️ user attributes ( unfortunately there are no typings for them could be added with TS generics i think )
So there is multiple methods, but any of the methods return all the required informations.
That said could you clarify which way is the suggested one to retrieve user information ?
and maybe could you explain why there is differences between the different methods/ way ? and how to retrieve missing information (e.g: for user groups when using loadUserProfile) ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi !
I'm currently working to revamp my authentication process on the front-end to move from 'login-required' to 'check-sso'. In the same time i moved to TS which brings a few more informations in current documentation (JS).
I write this discussion because i'm surprise there is no information about how to get the current user information. I believe this is an essential feature that should be documented even more when there is so much possibility. (From my point of view) This is all the places where you can find usefull informations about the user :
objectobjectobjectobjectfunctionfunctionTypescript types indicates that the latest options shouldn't be used so i won't consider it as an option :
Now there is 3 way to get the current user :
✔️ user id
✔️ user informations (such as name, email, etc...)
✔️ user groups
✔️ user roles by using realmAccess or/and resourceAccess
❌ user attributes
✔️ user id
✔️ user informations (such as name, email, etc...)
✔️ user groups
✔️ user roles
❌ user attributes
✔️ user id
✔️ user informations (such as name, email, etc...)
❌ user groups
✔️ user roles by using realmAccess or/and resourceAccess
✔️ user attributes ( unfortunately there are no typings for them could be added with TS generics i think )
So there is multiple methods, but any of the methods return all the required informations.
That said could you clarify which way is the suggested one to retrieve user information ?
and maybe could you explain why there is differences between the different methods/ way ? and how to retrieve missing information (e.g: for user groups when using loadUserProfile) ?
All reactions