Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I need to get the Id of the user logged in community for Visualforce Page. How can I get the login user in salesforce community and use in Visualforce Page?
In Visualforce, you can reference the User global variable.
In Apex, UserInfo methods should work just fine in the context of communities:
Id runningUserId = UserInfo.getUserId();
Required, but never shown