A 401 error, which indicates an "unauthorized" request, typically occurs when the system is unable to authenticate the user trying to access the embedded portal. This can happen for three main reasons:
Missing or Incorrect Shared Secret Key: The most common cause is that the portal has not been configured with a Shared Secret Key. This key acts as a secure password between your system and the embedded portal. You can resolve this by generating the key in your Rocketlane settings under Settings > Customer Portal > Embed Customer Portal.
Incorrect User ID: The error can also happen if the user ID used for the embedding is not recognized as a valid customer. This occurs when you use an email address that belongs to a vendor, internal team member, or anyone who is not designated as a customer in the system. To fix this, you must use an External ID that is associated with a customer to embed the portal.
Incorrect Project ID Data Type: If you're embedding the portal via code, the project ID must be passed as a number, not a string. Passing the ID as a string will cause the authentication to fail, resulting in a 401 error.