Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: Archivematica doesn't support OpenID Connect (OIDC) authentication #1053

Closed
5 tasks
helenst opened this issue Jan 14, 2020 · 13 comments
Closed
5 tasks
Labels
Type: feature New functionality.
Milestone

Comments

@helenst
Copy link

helenst commented Jan 14, 2020

Please describe the problem you'd like to be solved
There is no support for authentication via Open ID Connect (as provided by Microsoft Azure platform and others). Doing so would enable users in organisations that use these platforms to log in with their existing accounts.

Describe the solution you'd like to see implemented
The solution could be similar to existing Shibboleth and LDAP auth implementations:

  • enabled and configured from environment variables
  • invisible on implementations where it is not required
  • integrated with Django authentication system such that users can be automatically created
  • implemented on both Archivematica and Storage Service web interfaces
  • using existing libraries to provide the protocol implementations

Describe alternatives you've considered
There already are alternative ways to authenticate on Archivematica. This would provide an alternative method by which to do so.

Additional context
This has already been developed on the Wellcome fork.


For Artefactual use:

Before you close this issue, you must check off the following:

  • All pull requests related to this issue are properly linked
  • All pull requests related to this issue have been merged
  • A testing plan for this issue has been implemented and passed (testing plan information should be included in the issue body or comments)
  • Documentation regarding this issue has been written and merged
  • Details about this issue have been added to the release notes
@ross-spencer ross-spencer changed the title Support OpenID Connect authentication Problem: Archivematica doesn't support OpenID Connect (OIDC) authentication Jan 14, 2020
@sromkey sromkey added the Status: refining The issue needs additional details to ensure that requirements are clear. label Jan 27, 2020
@sromkey
Copy link
Contributor

sromkey commented Feb 4, 2020

@sevein Is this related to CAS at all?

@sevein
Copy link
Contributor

sevein commented Feb 4, 2020

It could be related, if CAS is set up with OIDC enabled (https://apereo.github.io/cas/5.1.x/planning/Architecture.html). Similarly, I believe that CAS can also be set up with SAML which Archivematica already supports (Shibboleth).

@sromkey sromkey added this to the 1.12.0 milestone Jul 6, 2020
@sromkey sromkey added Status: in progress Issue that is currently being worked on. and removed Status: refining The issue needs additional details to ensure that requirements are clear. labels Jul 14, 2020
@sromkey sromkey added Status: ready The issue is sufficiently described/scoped to be picked up by a developer. and removed Status: in progress Issue that is currently being worked on. labels Jul 21, 2020
@sevein
Copy link
Contributor

sevein commented Jul 28, 2020

@alexwlchan we've just merged support for CAS and OIDC is next on the list and with the v1.12 milestone on it. Do you have some time to rebase artefactual/archivematica#1536, artefactual/archivematica-storage-service#517 and artefactual/archivematica-docs#342? Thanks!

@tw4l
Copy link

tw4l commented Jul 28, 2020

@sevein @alexwlchan It might be best to hold off rebasing the Storage Service PR until artefactual/archivematica-storage-service#538 is merged, which should happen in the next day or two. Thanks!

@alexwlchan
Copy link

I’ll keep an eye on Tessa’s storage service PR, and look at getting some time to rebase our OIDC PRs.

How soon is the v1.12 release?

@sromkey
Copy link
Contributor

sromkey commented Jul 29, 2020

How soon is the v1.12 release?

We're aiming for August 28th, with a code freeze date of August 7th.

@tw4l
Copy link

tw4l commented Jul 29, 2020

@alexwlchan FYI, I just merged the CAS Storage Service PR into qa/0.x so you should be good to rebase now.

You might run into a known issue updating the Storage Service requirements in the Docker Compose dev environment. We're working a proper fix but for now there is a workaround described here: #1039 (comment).

@alexwlchan
Copy link

Do you have some time to rebase artefactual/archivematica#1536, artefactual/archivematica-storage-service#517 and artefactual/archivematica-docs#342?

Done, done and done!

@sevein
Copy link
Contributor

sevein commented Jul 30, 2020

Thank you!

@sevein sevein added Status: in progress Issue that is currently being worked on. and removed Status: ready The issue is sufficiently described/scoped to be picked up by a developer. labels Jul 30, 2020
@sevein
Copy link
Contributor

sevein commented Jul 30, 2020

@alexwlchan, I thought I would try this locally but I've stumped into something. I've set up testprovider which is what mozilla-django-oidc uses in their integration tests and I got pretty far with some changes I will describe below.

Added testprovider to Compose:

testprovider:
  stdin_open: true
  tty: true
  image: "mozilla/oidc-testprovider:oidc_testprovider-latest"
  ports:
    - "127.0.0.1:8080:8080"

These are the env strings I've added to archivematica-dashboard:

ARCHIVEMATICA_DASHBOARD_DASHBOARD_OIDC_AUTHENTICATION: "true"
OIDC_RP_CLIENT_ID: "1"
OIDC_RP_CLIENT_SECRET: "bd01adf93cfb"
OIDC_OP_AUTHORIZATION_ENDPOINT: "http://testprovider:8080/openid/authorize"
OIDC_OP_TOKEN_ENDPOINT: "http://testprovider:8080/openid/token"
OIDC_OP_USER_ENDPOINT: "http://testprovider:8080/openid/userinfo"

I had to make a change to the settings module (isn't it needed when using Azure?):

OIDC_AUTHENTICATION_CALLBACK_URL = "oidc_authentication_callback"

Also I updated the model in testprovider:

models.Client.objects.filter(pk=1).update(
    _redirect_uris="http://127.0.0.1:62080/oidc/callback/")

I am redirected to http://127.0.0.1:62080/oidc/callback/?code=... but JWS.from_compact(access_token) raises the following:

Compact JWS serialization should comprise of exactly 3 dot-separated components

Do you have any idea of what could be missing? Thank you in advance.

@alexwlchan
Copy link

Not sure off the top of my head; I’ll have a look at our config and send you the details tomorrow.

@alexwlchan
Copy link

alexwlchan commented Jul 31, 2020

@sevein I've had a look, and those two patches are very close to what we have in production (we just change the setting so Archivematica doesn't auto-create users when somebody logs in with OIDC – we create the AM user accounts manually and use people’s OIDC email as the account email).

These are the OIDC-related settings we're running in production:

AZURE_TENANT_ID = [uuid]
OIDC_RP_CLIENT_ID = [uuid]
OIDC_RP_CLIENT_SECRET = [secret]
OIDC_RP_SIGN_ALGO = RS256

The authorization/token/user endpoint are populated automatically, because we're running in Azure.

We don’t set the OIDC_AUTHENTICATION_CALLBACK_URL – I don't see where that setting is defined in the patch. Or is that a setting you'd expect to be defined somewhere?

Which docker-compose file are you using?

@sevein sevein self-assigned this Aug 3, 2020
@sevein
Copy link
Contributor

sevein commented Aug 3, 2020

OIDC_AUTHENTICATION_CALLBACK_URL is part of mozilla-django-oidc, but I think that was just a problem specific to my configuration where Django didn't know what was its external URL and the one shared with the provider wasn't later recognized. I'm using the docker-compose file found in our development environment.

I will consult the team but I think we're ok to merge as is. I'll suggest to mark as experimental until we learn more.

@sevein sevein removed their assignment Aug 6, 2020
@sevein sevein added Status: review The issue's code has been merged and is ready for testing/review. and removed Status: in progress Issue that is currently being worked on. labels Aug 6, 2020
@sromkey sromkey closed this as completed Aug 28, 2020
@sromkey sromkey removed the Status: review The issue's code has been merged and is ready for testing/review. label Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: feature New functionality.
Projects
None yet
Development

No branches or pull requests

5 participants