Is there some public URL at Riot that the user could control? Like a publicly accessible Bio that the user could insert a code in? Then a Discourse plugin could generate a code that the user would insert in their Bio and when they insert their riot username it’d check URL/<riot-username>/bio for that code?
Such a system would allow a fairly general-purpose plugin that could be configured for multiple third-party sites with some system settings.