Maintain issuer list
When Prosody is pinged about a user modification, it should get the user's issuer in the user account, store it with the user, and check if it already knows that issuer.
If it's a new issuer, it should register a client id for this issuer, get the userinfo url in the .well-known info, and store all these information with the issuer.
Once you got a new issuer you MUST use the endpoint https://issuer/.well-known/openid-configuration/
(for instance : http://127.0.0.1:8000/openid/.well-known/openid-configuration/ )
this endpoint will give you 2 useful endpoints :
{
"userinfo_endpoint": "http://127.0.0.1:8000/openid/userinfo",
"registration_endpoint": "http://127.0.0.1:8000/openid/register/"
}
The first is the /userinfo to use instead of the actual one.
The second is need to register prosody on the server. Examples here : https://openid.net/specs/openid-connect-registration-1_0.html#ClientRegistration