Using NextAuth 4 or 5 I need to create the following:
All works fine, but:
When the user logs out using signOut(), all it needs to log in again is to call signIn(). At the second login the user is not asked for his credentials, so somebody seeing his PC can login without being asked for username / password.
Is there a way to force NextAuth / Azure AD into asking for credentials at EVERY call to signIn()
Have you tried to use the prompt
parameter? An example in JS could look like this
import NextAuth from "next-auth";
import AzureADProvider from "next-auth/providers/azure-ad";
export default NextAuth({
providers: [
AzureADProvider({
clientId: "...",
clientSecret: "...",
tenantId: "...",
authorization: {
params: {
prompt: "login", // Force re-authentication
},
},
}),
],
});