update: authentication in a popup (Partial update) - #775
Conversation
WalkthroughThe documentation updates add iframe popup authentication guidance for the JavaScript and React SDKs, expand redirect and popup configuration references, and clarify hosted authentication framing protections, FAQ behavior, and related security metadata. ChangesIframe popup authentication
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant IframeApp
participant SDK
participant AuthPopup
participant KindeAuth
IframeApp->>SDK: Start authentication
SDK->>AuthPopup: Open popup for iframe context
AuthPopup->>KindeAuth: Load hosted authentication
KindeAuth-->>AuthPopup: Redirect to same-origin callback
AuthPopup-->>SDK: Return authentication result
SDK-->>IframeApp: Invoke success or error callback
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx`:
- Line 242: Update the popup user-gesture guidance in
src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx lines 242-242
to include logout() alongside login() and register(). Apply the same guidance
update in src/content/docs/developer-tools/sdks/frontend/react-sdk.mdx lines
299-299, ensuring logout() is documented as being invoked directly from a user
gesture.
In `@src/content/docs/get-started/learn-about-kinde/kinde-product-security.mdx`:
- Line 62: Update the sentence near the authentication-page security statement
to limit Kinde’s responsibility to maintaining controls for its hosted
authentication pages, and explicitly retain customers’ responsibility for
securing their own application pages.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3c4c453d-de44-428e-bdf5-34a58c4f7fe0
📒 Files selected for processing (4)
src/content/docs/authenticate/about-auth/kinde-authentication-faq.mdxsrc/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdxsrc/content/docs/developer-tools/sdks/frontend/react-sdk.mdxsrc/content/docs/get-started/learn-about-kinde/kinde-product-security.mdx
|
|
||
| The popup opens at 500 × 600 pixels, centred on the user's screen. This is not configurable in this SDK. If you need to control the popup dimensions, use the [React SDK](/developer-tools/sdks/frontend/react-sdk/#set-the-popup-size-and-position), which exposes a `popupOptions` option. | ||
|
|
||
| Browsers block popups that aren't opened in response to a user gesture, so call `login()` or `register()` directly from a click handler. When a popup can't be opened during sign-out, the SDK calls `on_error_callback` with the error `ERR_POPUP`. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Include logout() wherever popup user-gesture guidance is given. Both SDK pages document popup-based iframe logout, so logout must also be invoked directly from a user gesture.
src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx#L242-L242: Change the guidance to includelogout().src/content/docs/developer-tools/sdks/frontend/react-sdk.mdx#L299-L299: Change the guidance to includelogout().
📍 Affects 2 files
src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx#L242-L242(this comment)src/content/docs/developer-tools/sdks/frontend/react-sdk.mdx#L299-L299
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx` at line
242, Update the popup user-gesture guidance in
src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx lines 242-242
to include logout() alongside login() and register(). Apply the same guidance
update in src/content/docs/developer-tools/sdks/frontend/react-sdk.mdx lines
299-299, ensuring logout() is documented as being invoked directly from a user
gesture.
| To prevent [clickjacking](https://cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html) attacks where a user’s personal information or credentials may be stolen by hidden iFrames, use Kinde’s hosted pages for authentication. Hosted pages have protections in place such as such as strict CSP and security headers to prevent itself from being embedded as an iFrame. | ||
| To prevent [clickjacking](https://cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html) attacks, where a user's personal information or credentials may be stolen by hidden iFrames, use Kinde's hosted pages for authentication. Hosted pages have protections in place such as strict CSP and security headers to prevent them from being embedded as an iFrame. | ||
|
|
||
| Kinde controls and hosts the authentication pages, so the risk for protecting pages is assumed by Kinde rather than you. |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Clarify the shared security responsibility.
“Kinde rather than you” can imply that customers need not protect their own application pages. Limit this to Kinde maintaining controls for its hosted auth pages, while customers remain responsible for their application security.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/content/docs/get-started/learn-about-kinde/kinde-product-security.mdx` at
line 62, Update the sentence near the authentication-page security statement to
limit Kinde’s responsibility to maintaining controls for its hosted
authentication pages, and explicitly retain customers’ responsibility for
securing their own application pages.
This PR updates the documentation of auth in popup. It makes a partial update to 4 pages.
Summary by CodeRabbit