Use Case: There is a Community that the User has to login to using SSO. A custom SAML JITHandler is configured for the same to assign a PermissionSet to the User.

We now need to make this PermissionSet Session based. However we are unable to get the Session Id in the JIT handler. Tried using Auth.SessionManagement, and UserInfo.getSessionId() but both these calls error out.

Is there any other way to get the session id in the JIT Handler, or another way that we can implement the Session Based PermissionSet assignment?


The JIT handler executes before the user is logged in, so there's no session you can use. Instead, use a Login Flow to specify any Session Based Permissions. There's a trailhead that goes in to more details.

  • Hi @sfdcfox, thank you for your suggestion, the Community has an lwc component inbuilt, so we activated the PermissionSet through Apex via the LWC component. – Nevds Mar 17 '20 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.