Got an OIDC login error "Error decoding JSON from jwks_uri"

I’m using the NextCloud OIDC login app to let users login to my NextCloud instance from my main website.

I am using a OIDC server on the main host that is the free version and I’ve had to hack a couple of things on the OIDC server config to get it to work with my MediaWiki and Flarum instances.

Now that I’m setting up NextCloud, I need to work out what is going wrong with the hand-shaking between the NextCloud OIDC login module and the OIDC server, because at the moment after redirecting to the OIDC server, logging in and redirecting back to NextCloud, I then get the message:

  • Error decoding JSON from jwks_uri

How can I find out more about the problem that the OIDC app is having? Can I set it up to do more logging or can I monitor the HTTP calls to find any useful clues? Sorry, I’m new to both NextCloud and to OIDC config.