1

I'm trying to read Ip address of Logged in community user. I saw this question.

It seems Session's ip address is empty for community user for some reason.

SELECT Users.FirstName, SourceIp FROM AuthSession WHERE Users.Firstname='Danny' ORDER BY CreatedDate DESC LIMIT 1

enter image description here

So neither below would give me the Community user's Ip Address.

Map<String, String> session = Auth.SessionManagement.getCurrentSession();
String ipAddress = session.get('SourceIp');

Is there a way to retrieve it without using 3rd party libraries?

Thanks!

1 Answer 1

1

I had logged into the community by clicking Login as User on Contact, and it doesn't log the Ip Address, but other session details seem to be logged. But if you log in using real username and password it's logging the ip address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .