Nikola Tosic
10/27/2025, 6:30 AM&resourceInstanceKey=XYZ , and have managed to get elements UI loading properly (auth works). However, I can see no users/roles, and iframe FE code doesn't seem to pass the resourceId further. I can provide more diagnostic details, just not sure if this is good channel to do soOr Weis
10/27/2025, 6:38 AMOr Weis
10/27/2025, 6:39 AMNikola Tosic
10/27/2025, 6:49 AMNikola Tosic
10/27/2025, 6:59 AMOr Weis
10/27/2025, 7:10 AMNikola Tosic
10/27/2025, 8:09 AMElement iframe with https://embed.permit.io/workspace-access-management?envId=ABC&darkMode=false&resourceInstanceKey=G1&elementsToken=true not found
indicating there must be iframe already when the login is being loaded.
Before trying with token login and used cookie method, I would just create iframe using javascript dynamically upon successful login to elements API . Perhaps it's a fairly low complexity question that @Ask Inkeep can answerAsk Inkeep
10/27/2025, 8:09 AMAsk Inkeep
10/27/2025, 8:09 AMsupportsPrivateBrowser option. The iframe must be present in the DOM before calling the login method (1) .
Here's the proper sequence for implementing the token-based authentication:
1. First, create the iframe element in your HTML :
<iframe
title="Permit Element Name"
src="https://embed.permit.io/<ELEMENT_NAME>?envId=<SOME_UNIQUE_ID>&darkMode=false&resourceInstanceKey=<RESOURCE_INSTANCE_KEY>&tenantKey=<TENANT_KEY>"
width="100%"
height="100%"
style="border: none;"
/>
(2)
2. Then call the login method with the supportsPrivateBrowser option (1) :
permit.elements
.login({
loginMethod: LoginMethod.frontendOnly,
userJwt: '<USER_JWT>',
tenant: '<TENANT_KEY>',
envId: '<ENV_ID>',
supportsPrivateBrowser: true
})
.then((res) => {
// Handle successful login
})
.catch((err) => {
// Handle error
}) ;
The documentation emphasizes that ensuring login runs before the iframe loads is important to prevent issues with private browsing mode (3) . This means the login process should complete before the iframe attempts to authenticate, but the iframe element itself needs to exist in the DOM for the SDK to find it and inject the authentication token.
For a working example, check out the example project mentioned in the documentation (1) .Ask Inkeep
10/27/2025, 8:10 AMNikola Tosic
10/27/2025, 8:15 AMOr Weis
10/27/2025, 8:23 AMOr Weis
10/27/2025, 8:24 AMShuvy Ankor
10/27/2025, 8:25 AMNikola Tosic
10/27/2025, 8:26 AMpermitToken as in here - i'm trying to do this, but having endless loader bar, without any console / ajax errors. Trying to post message directly with the token to iframe (from console) doesn't work either. Not using React, plain TS compiled JSShuvy Ankor
10/27/2025, 8:34 AMNikola Tosic
10/27/2025, 9:06 AM