It's puzzling to me why my next-auth integration with Keycloak server is failing while the integration with Github is successful.
import NextAuth from "next-auth"
import KeycloakProvider from "next-auth/providers/keycloak";
import GitHubProvider from "next-auth/providers/github";
export default NextAuth({
debug:"true",
providers: [
KeycloakProvider({
id: "name",
clientId: "next-client",
clientSecret: "1231dasf23rFsafFASFarfdgfdg",
issuer: 'http://localhost:8080/auth/realms/myrealm',
}),
GitHubProvider({
clientId: "It2.cafasdfsads",
clientSecret: "213dascdg123r1f32f1fcwecwq"
})
],
})
Although I followed the documentation provided here, I am still encountering this error:
error: {
message: 'connect ECONNREFUSED ::1:8080',
stack: 'Error: connect ECONNREFUSED ::1:8080\n' +
' at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1237:16)',
name: 'Error'
},
providerId: 'name',
message: 'connect ECONNREFUSED ::1:8080'
}
In Keycloak, my access type is set to confidential and my redirect URL is http://localhost:3000. The version of Next-Auth being used is "next-auth": "^4.10.2"