Django Allauth: Keycloak Authentication Fails with "Connection Refused" Error
`I’m integrating Keycloak with my Django application using django-allauth for OpenID Connect authentication. I’ve set up the configuration, but when I click on the “Login with Keycloak” link, I encounter the following error:
HTTPConnectionPool(host=’localhost’, port=8081): Max retries exceeded with url: /realms/customercloud/.well-known/openid-configuration (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x7f8d322fb100>: Failed to establish a new connection: [Errno 111] Connection refused’))
/**login.html **/
<a href="{% provider_login_url 'openid_connect' %}">Login with Keycloak</a>
`SOCIALACCOUNT_PROVIDERS = {
“openid_connect”: {
“APP”: {
“provider_id”: “keycloak”,
“name”: “Keycloak”,
“client_id”: “myclient”,
“secret”: “********************“,
“settings”: {
‘server_url’: ‘http://localhost:/realms/customercloud/.well-known/openid-configuration’,
‘client_id’: ‘myclient’,
‘redirect_uri’: ‘http://localhost:***/‘,
},
}
}
}
`
‘
NAV is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.