Closed FantasticoFox closed 6 months ago
With these commits, MW side is good
Load OIDC dependencies https://github.com/inblockio/aqua-docker-mediawiki/pull/5
Fix connection https://github.com/inblockio/aqua-PKC/commit/3276f063fb15f95c7755582ecadce7cb43976ab7
This will make sure that OIDC extension has all dependencies and is configured correctly.
This requires siwe-oidc
domain to be added to /etc/hosts
on the local machine. Its not nice, i know, ill try to work around this requirement, but for now, as we need to make call to SIWE from both the browser and inside the container, its needed
Im having trouble with getting the IdP to work. I only get white screen, with no errors in docker logs
.
I can confirm that it receives the request from wiki, which looks good to me
/authorize?response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A9352%2Findex.php%2FSpecial%3APluggableAuthLogin&client_id=siwe&nonce=360ada8e44cb7d5adde7d2ac99035e28&state=d615a4e62e3fbf7097473c60d7bd08fb&scope=openid+profile+openid
I found very little of the non-library docu on SIWE, so not sure how to proceed there. Maybe with these changes, you guys can get further in getting SIWE itself working
We are running into two issues:
Resolve container name resolution problem: hack use localhost --> then it works -- it should work by exposing the container to the host with the DNS configured by the docker DNS service
User not recognised by mediawiki (OIDC) does not recognise the user to be the same between the mediawiki DB and the OIDC while the string is idendical. We assume its creating a new user again with a '1' in the end because username was already taken and there is conflicting. With the upgrade from EAUTH to SIWE we are now case-sensitive. As this is an error correction code with in the wallet address, this is desired.
@rht raised an issue https://github.com/spruceid/siwe-oidc/issues/86
I was able to look into the domain resolution issue.
Problem is that OIDC will make calls to SIWE container both inside the container and outside (browser redirects).
Issue with this working with localhost
is that localhost
is not available inside the pkc container.
Thing that fails is this: https://github.com/jumbojett/OpenID-Connect-PHP/blob/master/src/OpenIDConnectClient.php#L621 It tries to contact it on localhost
insdie the container, which wont work.
I dont see a good solution to this, but some ideas are:
localhost
in certain endpoint on http://localhost:9353/.well-known/openid-configuration, even if domain is set to siwe-oidc
(dont know how to do that)localhost:9353
to siwe service (definitelly now know how to do)As for the other issue, how do you even get to users being created? Even if i hack siwe-oidc
in the hosts file, i still get a white page when arriving to siwe. What do i need to do?
patch the openid-connect-php lib so that it uses different domains for in and out calls (i can probably do that), but its a hack, and subject to breaking if library code changes
I prefer this option, because forking the SIWE requires us to maintain a Docker image, and seems to require more maintenance than maintaining a fork which requires occasional rebase of 2-3 lines of change to OpenID-Connect-PHP and the https://github.com/wikimedia/mediawiki-extensions-OpenIDConnect.
I agree with @rht and in addition to this, this is in your realm of expertise which makes it actionable.
@rht opened https://github.com/spruceid/siwe-oidc/issues/88 to resolve the whitepage issue caused by the SIWE docker container upgrade
@rht are the issues with usernames also happening to you?
1
is added at the end of the usernameI haven't tested, but I have observed that the first one happened to @FantasticoFox 's laptop, but not the second one.
First one is more important. Please test when you get a chance
No entry in etc/hosts
will be requried with these patches
https://github.com/inblockio/aqua-PKC/pull/130
https://github.com/inblockio/aqua-docker-mediawiki/pull/6
Done and working
Requirement: Upgrade the Mediawiki container built process to include a working SIWE (https://github.com/spruceid/siwe) Outcome: alpha-1.0.4 release with the SIWE and OIDC plugin implemented in the container.
docker compose logs
.Context:
composer update
andphp maintenance/update.php
as instructed, but still same error