function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
silkkengsilkkeng 

Salesforce Session

Hi all,
Does anyone know if there is a way to check the current login user's session?
For example, a user login to salesforce and press a custom button to call another external web URL. Before he get redirect to the URL, i should then verify if he is part of the named user. If is not in the list, I will denied his request.


Or if you have any good suggestion? Please advise

Thanks and appreciates

Regards,
David
yura.tkachenkoyura.tkachenko
Hi,

I guess it depends on rules where you want to check this user. If you want to check on your site then you can pass in custom link: serverUrl, sessionId and using these parameters make WS API call: getUserInfo() after that you grant or deny access. But if the question how to do it on SFDC site then it requires to know what the rules to grant access for users.

Thanks,
Yura.
silkkengsilkkeng
Hi,
Thanks for your reply.
I want to validate this user from our server. When a request pass to our server URL with their session, we need to validate if the user in this session is our existing staff.
So long as we know this user is our staff and currently logged in to Salesforce, we'll be able to let him do what he wants. When we get this session, we also need to check if salesforce, if this session is true/false.