ubccr / mokey

FreeIPA self-service account management portal
BSD 3-Clause "New" or "Revised" License
189 stars 45 forks source link

Redirect URL #66

Closed jvinolas closed 3 years ago

jvinolas commented 3 years ago

I've setup a mokey (mokey version 0.5.4) with hydra (oryd/hydra:v1.9.2) and tried to social login with nextcloud app. When I click on Hydra social login it redirects to mokey login from hydra correctly (http://mokey.server/auth/login?login_challenge=d4afe584f0e74efab7e4181782e804b0).

Then I validate with a freeipa (FreeIPA, version: 4.8.7) user and it goes to the mokey profile, when I expect to be redirected to consent page and then to nextcloud with valid token. As I see in the logs there is no redirect URL:

{"time":"2021-02-20T21:29:22.952615656Z","level":"ERROR","prefix":"echo","file":"server.go","line":"65","message":"code=404, message=Not Found, internal=<nil>"}
time="2021-02-20T21:29:31Z" level=info msg="Redirect URL" wyaf=/

It seems mokey is not taking into account the configuration of hydra in mokey.yml. It doesn't matter what I set there that it won't access again to hydra.

hydra_admin_url: "http://hydra.server:4444"
hydra_consent_timeout: 86400
hydra_login_timeout: 86400
# hydra_fake_tls_termination: true

Where should I set up that redirect URL? From the logs it seem there is a missing 'prefix' with 404 return code.

jvinolas commented 3 years ago

Ok, my mistake. I configured hydra to redirect to auth/login instead of oauth/login

aebruno commented 3 years ago

@jvinolas Awesome! Glad you got it sorted it out. We really need better documenation for the hydra integration. If you're up for writing up the steps you did to get it going we always welcome any PRs. Thanks for trying out mokey!