Add Idp-Initiated SSO (#6781)

* wip idp enabled login

* add route to handle callback from IdP

* update the new provider

* cleanup

* fix the type

* add suggested changes

* make the suggested changes

* use client secret verifier

* Make [...nextauth] a little easier to read

---------

Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Omar López <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-03-07 14:31:39 -07:00
1 parent 7eecc311e0
commit 2fa83bd512
8 files changed
+122 -22

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { signIn } from "next-auth/react";
import { useRouter } from "next/router";
import { useEffect } from "react";
// To handle the IdP initiated login flow callback
export default function Page() {
const router = useRouter();
useEffect(() => {
if (!router.isReady) {
return;
}
const { code } = router.query;
signIn("saml-idp", {
callbackUrl: "/",
code,
});
}, []);
return null;
}