This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can use the existing OKTA provider multiple time and override the values to make it unique.
Export unique ENV for CLIENT_ID,CLIENT_SECRET domain
api/auth/[...nextauth].js file
providers: [
Providers.Okta({
id: "dev-02783336",
name: "dev-02783336",
clientId: process.env.OKTA1_CLIENT_ID,
clientSecret: process.env.OKTA1_CLIENT_SECRET,
domain: process.env.OKTA1_DOMAIN,
}),
Providers.Okta({
id: "venuokta",
name: "venuokta",
clientId: process.env.OKTA2_CLIENT_ID,
clientSecret: process.env.OKTA2_CLIENT_SECRET,
domain: process.env.OKTA2_DOMAIN,
})
NOTE: the callback url will have the id you have provided above, use this to configure "Sign-in redirect URIs" http://localhost:3000/api/auth/callback/[id]
example: