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

How to get sessionId in canvas app?

AnudeepAnudeep (Salesforce Developers) 
Hi Sumit, 

When you create a canvas app, you can use one of the following authentication methods:
  • Signed Request
  • OAuth 2.0
In OAuth 2.0, the access token is a session ID and can be used directly. You will find steps to retrieve the access token in this document

If you find this information helpful, please mark this answer as Best so that it may help others in the community. Thank You

Hi Anudeep,

I tried creating a signed request but I am getting an empty body in request object inspite of getting an encoded signed request when I open tab containing canvas. Also in permitted users setting on connected app I have choosen "Admin approved users are pre-authorized". Also in profile related list I had added System Administrator and Standard User. I don't know what am I doing wrong.