Discourse is currently the software that I think has the highest degree of technical freedom, so I chose it as my forum. But I encountered ‘Discovery document is missing’ error when configuring OIDC, which took me a week , and I did not find a suitable solution here.
I successfully built Discourse according to the following tutorial:
Then I used docker to build Keycloak, and both Keycloak and Discourse were deployed locally. When I established the connection of Discourse and keycloak through OIDC, I encountered the following error:
OIDC Log: Fetching discovery document raised error Faraday::ConnectionFailed FinalDestination: all resolved IPs were disallowed
(oidc) Authentication failure! openid_connect_discovery_error: OmniAuth::OpenIDConnect::DiscoveryError, Discovery document is missing
OmniAuth::OpenIDConnect::DiscoveryError (Discovery document is missing) lib/middleware/omniauth_bypass_middleware.rb:53:in `call' lib/content_security_policy/middleware.rb:12:in `call' lib/middleware/
According to this error I found the corresponding solution as follows:
After following the solution, a new error was reported as follows:
I am likely off base here, but since Discourse and Keycloak are both deployed locally with Docker, are you sure that Discourse can make requests to Keycloak? It’s something I’ve run into trouble with in the past. I know it can be made to work though.
Thank you for your patient reply which gave me a good idea . You are indeed right. The local keycloak service cannot be accessed through localhost or 127.0.0.1, so I use the host’s IP instead of localhost. But a new problem has arisen: