Xwiki credentials for other apps

Hi there.
We have an XWiki instance with few thousand users registered using normal Registration process. We are not using LDAP or the like.

Now we will be using a forum app “Discourse” for our needs (the one XWiki is using).

What we want:

  1. Login to forum using our wiki user credentials.
  2. If possible, SSO (single sign on).

Can someone pls guide us to the right direction?

Here is what we did for this Discourse instance:

622Z

Thank u. Is there anything I have to do in xwiki setup except installation of openID?

Nothing to configure usually, just install the OpenID Connect Provider.

where can i get these oauth2 configs? like oauth2 authorize url, token url, json url??

Have you installed the Oauth2 plugin on Discourse as I indicated ?

Yes I have installed oauth2 plugin on discourse as u said. Also installed openid on xwiki instance

And you don’t find the configuration field listed in my screenshot ? In Discourse setting you have a filter input where you can put “oauth2” to get only the settings you are interested in.

Oh u got me wrong. I found that in settings. But I’m not sure what URLs to use in the fields. I wanted to ask how can I know what URLs to type in there.

The endpoints are listed on https://extensions.xwiki.org/xwiki/bin/view/Extension/OpenID%20Connect/OpenID%20Connect%20Provider/. But simply take the URLs from the screenshot and replace the base URL with yours so generally something like https://myhost/xwiki/oidc/... (remove /xwiki if you installed XWiki as default application).

1 Like

Sorry but it is not working for me.
I did exactly as described:

  1. Installed OpenID connect provider
  2. In discourse OAuth2, entered the endpoints.
  3. I removed /xwiki as it is default application.
    It is taking me to my xwiki site but throws a notice that the page doesn’t exist. I have attached a screenshot below.
    Screenshot_20190510-122626

For login, it is redirecting me to
https://www.wikinote.org/oidc/authorization?client_id=forum&redirect_uri=https%3A%2F%2Fforum.wikinote.org%2Fauth%2Foauth2_basic%2Fcallback&response_type=code&state=c201c6f0bec19b9efce8c2994671a0d1f1b49b655767f4eb

which in the case for XWiki discourse is

https://www.xwikiorg-node1.xwikisas.com/xwiki/bin/login/XWiki/XWikiLogin;jsessionid=A637D09954F7C54758A5B50C2D8A8A8A.node1?srid=bCPMPbJ0&xredirect=%2Fxwiki%2Foidc%2Fauthorization%3Fclient_id%3Dforum%26redirect_uri%3Dhttps%3A%2F%2Fdiscourse.xwiki.org%2Fauth%2Foauth2_basic%2Fcallback%26response_type%3Dcode%26state%3Df90d30a460d1334706397b01f9d2a075222354e214eb8746%26srid%3DbCPMPbJ0

This suggest that the provider is not actually found (as if it was not really installed). Do you have any error in the log ? You might want to try to restart maybe.

the error says: Failed to load resource: the server responded with a status of 404 ()
i tried reinstalling oidc, restarting server, etc. but no luck yet

This one is because the provider is not there. I was referring to an error before that one that could help us find out why it was not initialized.