fief-dev / fief

Users and authentication management SaaS
https://www.fief.dev
Other
486 stars 42 forks source link

client -> redirect_URI validation flow #329

Open ocontant opened 4 months ago

ocontant commented 4 months ago

Describe the bug

When entering multiple URI via the GUI for a client, only the first entry is validated for https. The validation logic stops at the first entry found that fail the validation. Once the failed entry is fixed, the test pass and doesn't test the other entries.

To Reproduce

  1. Goto http://fief.localhost/admin/clients/
  2. Select a Client
  3. Click Edit Client
  4. click add redirect_URI to have >1 entries.
  5. Enter multiple http (not TLS) URI entry (>1) in the client redirect_URI

The system will complain that the first entry is http and not https.

Expected behavior

Every entries should be tested and should pass validation.

Configuration

ocontant commented 4 months ago

I would argue that forcing https for the callback is cumbersome for development context where everything run on localhost context.

May I suggest a checkbox to disable force https, or a .env variable (please advise if already available)

frankie567 commented 4 months ago

I can't reproduce the behavior you describe. I've checked and the system does check that every URL are in HTTPS:

Capture d’écran 2024-02-05 à 08 50 14 Capture d’écran 2024-02-05 à 08 50 22

Regarding enforcing HTTPS on Redirect URL, we do have an environment variable to disable this behavior: https://docs.fief.dev/self-hosting/environment-variables/#client-redirect-uris

ocontant commented 4 months ago

That's odd. I could repeat it multiple time by adding removing field, saving editing and so on.

Surprisingly, the first attempt allowed to have the first entry as https and the other entries as http (I had 4 address total when I tested). Every time, i save and edit, the next http would flag and wouldn't allow to save.

If you don't have this behaviour, and you can't reproduce. Let's just assume some gremlins on my system. I might have something non standard.