Guest user access for Web Embeddables
Enable unauthenticated users to access Web Embeddables components on your third-party website without logging in.
Overview of Web Embeddables for guest users
- Knowledge article view component
- Catalog item component
- Install the guest plugin
- Enable the component ACLs
- Set the system property
- Implement the global code on your third-party website
- Embed the component on your third-party website page. For more information, see Embed ServiceNow components instance on the third-party website.
- Make content displayed in components public
Guest users support activation
Activate the Web components for Guest Embeddables (sn_guest_component) plugin to enable guest user support on your website. For more information on how to activate the plugin, see Activate Web Embeddables.
Enable the component ACLs
For guest user to view or interact with the components on your third-party website, you must enable the guest ACLs of the components . For more information, see Configure ACL for guest access.
Guest users system properties
| Property | Description | Behavior |
|---|---|---|
| glide.embedded.session.trust.verification.enabled | Enable verification to check that the guest embeddable session is created on a trusted third-party website. The verification happens through JWT token. | When set to true, the system checks for a JWT token before creating an embedded guest session. When set to false, the system creates a guest embedded session without verification. By default, the property is set to true. Pass the JWT token using the value for the key: |
Global code implementation
- On page load: Uncomment to call
await startGuestSession()function. This establishes an anonymous session so guest components (for example, a public-facing knowledge view component) render without requiring the user to sign in. - After user logs in: Uncomment to call
await login()function. This upgrades the session to an authenticated one, causing authenticated components to load for that user. Guest components are replaced or supplemented by the logged-in experience depending on your configuration. - On logout: Uncomment to call
await logout()function to suspend down the authenticated session and return to the guest state if needed.
guestTokenCallback function is required in init() function for guest sessions to work. This callback must return a valid guest JWT token for your instance. Without it,
startGuestSession() function fails validation.To display content in the guest components, make knowledge articles and catalog items public.
Guest users can access the Web Embeddables components designated as public on your website without logging in.