Use keycloak authentication for the deposit
The deposit is using django and a simple basic authentication scheme so far (compliant to the sword v2 specification).
Investigate how to continue offering such basic authentication in coordination with keycloak.
Migrated from T2858 (view on Phabricator)
Designs
- Show closed items
- swh/infra/sysadm-environment #3166
- swh/devel/swh-auth !45
- swh/devel/swh-environment !239
- swh/devel/swh-auth !6
- swh/devel/snippets !10
- swh/devel/swh-auth !3
- swh/devel/swh-auth !2
- swh/devel/swh-auth !1
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Antoine R. Dumont mentioned in issue #2714
mentioned in issue #2714
- Antoine R. Dumont mentioned in merge request !219 (closed)
mentioned in merge request !219 (closed)
- Antoine R. Dumont mentioned in merge request swh-auth!1 (closed)
mentioned in merge request swh-auth!1 (closed)
- Antoine R. Dumont mentioned in merge request swh-auth!2 (closed)
mentioned in merge request swh-auth!2 (closed)
- Antoine R. Dumont mentioned in merge request swh-auth!3 (closed)
mentioned in merge request swh-auth!3 (closed)
- Antoine R. Dumont mentioned in merge request snippets!10 (closed)
mentioned in merge request snippets!10 (closed)
- Antoine R. Dumont mentioned in merge request !223 (closed)
mentioned in merge request !223 (closed)
- Antoine R. Dumont mentioned in merge request swh-auth!6 (closed)
mentioned in merge request swh-auth!6 (closed)
- Antoine R. Dumont mentioned in merge request !231 (closed)
mentioned in merge request !231 (closed)
- Antoine R. Dumont mentioned in merge request !232 (closed)
mentioned in merge request !232 (closed)
- Antoine R. Dumont mentioned in merge request !399 (closed)
mentioned in merge request !399 (closed)
- Antoine R. Dumont mentioned in merge request swh-environment!239 (closed)
mentioned in merge request swh-environment!239 (closed)
- Antoine R. Dumont mentioned in merge request swh-auth!45 (closed)
mentioned in merge request swh-auth!45 (closed)
- Antoine R. Dumont added Authentication SWORD deposit priority:Normal labels
added Authentication SWORD deposit priority:Normal labels
- Maintainer
Discussion on deposit sprint with @ardumont and @anlambert
- login / mdp classic (not most secured)
- authentication by token
- create account for each application and give permissions depending on the account
- to give permission for the deposit functionality an admin needs to change the account permission
- we don't want to break the existing usage (login /mdp) => use login/mdp
- you get the login/mdp in headers from clients,
- the server will send it to keycloak authentication backend (which is used in swh-web
- direct grant (Oauth) open ID connect
First step: change the existing clients and create their accounts (in keycloak) Test in Docker Second step: transfer to client's account in staging
- Author Maintainer
direct grant (Oauth) open ID connect
Also known as "Resource Owner Password Credentials" [1]
(RFC [2] has an ascii graph detailing the mechanism)
Details:
-
deposit client provides credentials to the deposit server
-
deposit server forwards credentials to check the client authentication against keycloak
-
keycloak accepts connection and provides a token to the deposit server. The client is now connected.
-
deposit drops the client's credentials (no longer uses them).
-
As the deposit client is now connected, the deposit can proceed as usual.
-
Alternatively if the authentication fails (keycloak refuses connection), deposit forwards a 401 as before.
-
- Phabricator Migration user mentioned in commit 27efcccb
mentioned in commit 27efcccb
- Phabricator Migration user mentioned in commit swh-environment@11b01889
mentioned in commit swh-environment@11b01889
- Antoine R. Dumont added state:wip label
added state:wip label
- Phabricator Migration user mentioned in commit swh-environment@dabe1c91
mentioned in commit swh-environment@dabe1c91
- Antoine R. Dumont assigned to @ardumont
assigned to @ardumont
- Phabricator Migration user mentioned in commit 4353a323
mentioned in commit 4353a323
- Author Maintainer
Currently, the deposit migration scripts are not tested. Which would have been hard to be serene about the future keycloak change.
So a new dependency grew in the test requirements and some tests got started to actually test some migrations. Dependency added in !219 (closed).
That module was not packaged for debian. It is now in the swh debian repository. And, it's our jenkins instance which does the build [1] (v1.1.0 [2]).
To ensure it works as expected with the deposit, an intermediary deposit release got specifically built to ensure the tests are now fine with that dependency (v0.11.1 [3]).
And it is (in one round for both, no less \o/).
unstable:
12:58:48 swh/deposit/tests_migration/test_migrations.py::test_migrations_20_rename_swhid_column_in_deposit_model PASSED [ 60%] 12:58:48 swh/deposit/tests_migration/test_migrations.py::test_migrations_21_add_origin_url_column_to_deposit_model PASSED [ 60%]
stable (backport):
13:00:40 swh/deposit/tests_migration/test_migrations.py::test_migrations_20_rename_swhid_column_in_deposit_model PASSED [ 99%] 13:00:41 swh/deposit/tests_migration/test_migrations.py::test_migrations_21_add_origin_url_column_to_deposit_model PASSED [100%]
So now, we shall be able to test our schema migrations in the deposit!
Starting with the new keycloak changes. So some delay to deliver this but for the good cause!
- Phabricator Migration user mentioned in commit swh-auth@acf199d6
mentioned in commit swh-auth@acf199d6
- Phabricator Migration user mentioned in commit swh-environment@6f30f451
mentioned in commit swh-environment@6f30f451
- Phabricator Migration user mentioned in commit swh-auth@9d1659b9
mentioned in commit swh-auth@9d1659b9
- Phabricator Migration user mentioned in commit swh-environment@5c3137c5
mentioned in commit swh-environment@5c3137c5
- Phabricator Migration user mentioned in commit swh-auth@148c9d4f
mentioned in commit swh-auth@148c9d4f
- Phabricator Migration user marked this issue as related to swh/meta#3128
marked this issue as related to swh/meta#3128
- Phabricator Migration user mentioned in commit swh/infra/puppet/puppet-swh-site@fc6a5a5a
mentioned in commit swh/infra/puppet/puppet-swh-site@fc6a5a5a
- Phabricator Migration user mentioned in commit snippets@5162e8e1
mentioned in commit snippets@5162e8e1
- Phabricator Migration user mentioned in commit swh-auth@57583d2b
mentioned in commit swh-auth@57583d2b
- Phabricator Migration user mentioned in commit swh/infra/puppet/puppet-swh-site@9cb4154b
mentioned in commit swh/infra/puppet/puppet-swh-site@9cb4154b
- Phabricator Migration user mentioned in commit swh-environment@985a05d8
mentioned in commit swh-environment@985a05d8
- Phabricator Migration user mentioned in commit 6773775a
mentioned in commit 6773775a
- Phabricator Migration user mentioned in commit e89d2f14
mentioned in commit e89d2f14
- Phabricator Migration user mentioned in commit feaca0ab
mentioned in commit feaca0ab
- Phabricator Migration user mentioned in commit ba44a973
mentioned in commit ba44a973
- Phabricator Migration user mentioned in commit swh-auth@45ec395c
mentioned in commit swh-auth@45ec395c
- Phabricator Migration user marked this issue as related to swh/infra/sysadm-environment#3166 (closed)
marked this issue as related to swh/infra/sysadm-environment#3166 (closed)
- Phabricator Migration user mentioned in commit 9453e8eb
mentioned in commit 9453e8eb
- Maintainer
InvenioRDM tests on staging looks good
- Phabricator Migration user mentioned in commit 82e56c9e
mentioned in commit 82e56c9e
- Author Maintainer
Deployed.
- Antoine R. Dumont removed state:wip label
removed state:wip label
- Antoine R. Dumont closed
closed