Thanks to visit codestin.com
Credit goes to github.com

Skip to content

configurable scopes for OpenID auth - #2083

Merged
chrisknoll merged 3 commits into
OHDSI:masterfrom
m0nhawk:openid-scopes
Sep 28, 2022
Merged

chrisknoll merged 3 commits into
OHDSI:masterfrom
m0nhawk:openid-scopes

Conversation

@m0nhawk

@m0nhawk m0nhawk commented Aug 20, 2022

Copy link
Copy Markdown
Contributor

I found out that some of the OpenID providers requires specifying special scopes.

This PR includes new configuration option security.oid.scopes which should have values space-separated values scopes, e.g. openid user.

@chrisknoll

Copy link
Copy Markdown
Collaborator

Any chance that you could add a reasonable 'default' value in pom.xml or is a null value an acceptable value (null is what you'll get in the @Value annotation if there's no value copied in from the pom.xml)?

@m0nhawk

m0nhawk commented Aug 21, 2022

Copy link
Copy Markdown
Contributor Author

@chrisknoll I was looking into pac4j documentation, but haven't found anything specific on default values, so looked into source code here. And it looks like it's the same default null values, so I'm unsure on if it needs anything else.

@chrisknoll

Copy link
Copy Markdown
Collaborator

I found some documentation on OpenID 'scope' but not sure if the scopes described there are the same property as the scope you are referring in this PR.

It seems to indicate that openid is a required scope, but it's also possible that it assumes that scope will be used for any access, so maybe the property is for 'additional scopes'. I don't know enough about OpenID to know.

@m0nhawk

m0nhawk commented Aug 22, 2022

Copy link
Copy Markdown
Contributor Author

Yes, that's the same.

The openid is actually required by the OpenID spec: here, so you may be right to have configuration like extraScopes.

I've made the changes, I agree, that would be more straightforward and up to spec.

Comment thread src/main/java/org/ohdsi/webapi/OidcConfCreator.java
@m0nhawk
m0nhawk requested a review from alex-odysseus August 23, 2022 19:38
@m0nhawk

m0nhawk commented Sep 9, 2022

Copy link
Copy Markdown
Contributor Author

Is there any other changes that may be needed? I like to move further with this with at least running the testing workflow.

@chrisknoll

Copy link
Copy Markdown
Collaborator

If the default behavior here results in the same behavior pre-PR, then I'm fine with these changes. Are you asking if you should provide unit tests for these changes?

@m0nhawk

m0nhawk commented Sep 11, 2022

Copy link
Copy Markdown
Contributor Author

@chrisknoll Yes, it should be the same behavior, as openid is a required scope.

I was trying to find any example of tests, but saw nothing for OpenID tests.

@chrisknoll

Copy link
Copy Markdown
Collaborator

Ok, I found some security tests (that make HTTP requests) here. Not sure if that makes a good model because, in the case of openid, we'd need some sort of testing context to mock an openid provider. Having a test case for this would be ideal, but we've left testing confirmation to external parties and accepted PRs on their certification.

@alex-odysseus or @anthonysena : do you have any OpenID environment set up that we could run an openID test using this new scope functionality?

@anthonysena

Copy link
Copy Markdown
Collaborator

@alex-odysseus perhaps ELIXIR could be a suitable place to test this functionality? Our test environment has expired but wondering if you have access to one with OpenID?

@chrisknoll

Copy link
Copy Markdown
Collaborator

We'll accept this PR now because it appears to be low risk, and we can work on formalized unit tests for this functionality at a later date.

@chrisknoll
chrisknoll dismissed alex-odysseus’s stale review September 28, 2022 16:43

We agreed that this is low risk and can make additional updates later.

@chrisknoll
chrisknoll merged commit 2e4404b into OHDSI:master Sep 28, 2022
@m0nhawk
m0nhawk deleted the openid-scopes branch September 28, 2022 20:44
@alex-odysseus

Copy link
Copy Markdown
Contributor

We will check it internally with Google I believe. We can also give it a try with Life Science (aka ELIXIR AAI) though I remember there were a few complications when we were implementing OpenID Connect (OIDC) in ARACHNE for this particular Identity Provider when scopes are involved @chrisknoll @anthonysena

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants