GitHub user maazwaheed123 added a comment to the discussion: ### Bug: SSO
Logout Not Working with Keycloak + Iframe Embedded Superset
@dosu my logout and superset iframe are in 2 different pages:
this logout function :
const logout = async (): Promise<void> => {
window.location.href =
`${process.env.NEXT_PUBLIC_KEYCLOAK_URL}realms/${process.env.NEXT_PUBLIC_KEYCLOAK_REALM}/protocol/openid-connect/logout`;
};
is in one page, this iframe is in another page:
import { useAuth } from '@/authentication/AuthContext';
import Layout from '@/components/Layout'
import { useRouter } from 'next/router';
import React from 'react'
const QueryEditor = () => {
const router = useRouter();
const { user }: any = useAuth();
const isAdmin: any =
user?.resource_access?.[`${process.env.NEXT_PUBLIC_KEYCLOAK_CLIENTID}`]?.roles.includes("client_admin");
const isAuditor: any =
user?.resource_access?.[`${process.env.NEXT_PUBLIC_KEYCLOAK_CLIENTID}`]?.roles[0]==='auditor';
if(!isAdmin && isAuditor ){
router.push('/404')
}
return (
<Layout>
<iframe
src={`${process.env.SUPERSET_BASE_URL}`}
sandbox="allow-same-origin allow-scripts allow-forms allow-popups
allow-top-navigation"
allow="autoplay; fullscreen"
width="1400"
height="800"
/>
</Layout>
)
}
export default QueryEditor
how to add it correctly now , my frontend is in next js
GitHub link:
https://github.com/apache/superset/discussions/33685#discussioncomment-13365092
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]