apache / couchdb-fauxton

Fauxton is the new Web UI for CouchDB
https://github.com/apache/couchdb-fauxton
Apache License 2.0
382 stars 224 forks source link

Support for IdP AIuthentication [Do not merge yet - Feedback requested] #1465

Open Stwissel opened 1 month ago

Stwissel commented 1 month ago

Overview

Preliminary pull request - not ready for merge yet. To collect feedback.

This PR adds support for OIDC / JWT authentication by adding a button to the login screen and a screen to login using IdP parameters.

Screenshot 2024-10-23 at 21 39 56

The (WIP) IdP authentication screen looks like this:

Screenshot 2024-10-23 at 21 40 48

Ideally I would read the parameters from the server, so the experience would be similar to Cloudant, some advice needed.

Changes

Testing recommendations

Open questions / feedback

GitHub issue number

Fixes #1457

Checklist

janl commented 3 weeks ago

Heya, thanks for this contributions, there are a lot of moving parts here, so a review will be a bit slow, but overall this looks pretty cool. I hope we can give this a spin soon. In the meantime, I have approved the PR tests to run on this.

Stwissel commented 3 weeks ago

Awesome thx. The big question is user experience. Ideally (?) it would be a server side configuration, if there is a way without altering CouchDB.

Or maybe it is ok like that?

janl commented 3 weeks ago

I might be missing something, but what changes in CouchDB would be needed?

Stwissel commented 2 weeks ago

What would be nice is the ability to store the IdP information sever side.

For this some URL where an unauthenticated http fetch request could read a json file with the IdP information. There might already be such an option (?) to retrieve a configuration value.

It would need to work even when you prevent unauthenticated access otherwise (require_valid_user=1)

janl commented 2 weeks ago

Does the file have to have any particular format or is this just to hardcode the URL, so we don’t have to have that field in Fauxton?

Stwissel commented 2 weeks ago

any format will do

my thought was a fixed URL (e.g. /_idp) that delivers some content.

We need:

In case there is no option in current config, I can modify the code to first check an URL (in a future version of CouchDB) e.g. /_idp and if that's not available fall back to a local config.

Another thought: as a stopgap measure: use http(s)://couchdburl/idp/fauxton. It wouldn't work with require_valid_user=1, but prove the approach.

What options do you see?

Stwissel commented 2 weeks ago

I'm warming up to the idea of using http[s]//couchDBserver[:port]/[_idp|idp/fauxton]

This would work (with the limitation of require_valid_user=0) on any existing server and with a future _idp URL once it is becoming available.

However it would require _idp to send JSON.

Does that make sense / would that be a way forward?