-
Couldn't load subscription status.
- Fork 2.9k
NIFI-7924: add fallback claims for identifying user #4630
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
Conversation
|
@sjyang18 Thank you for submitting this. I've reviewed it and the functionality LGTM. I verified I can log in with OIDC enabled and verified the tests will use the listed fallback claim when email is not available. One suggestion is to update the NiFi docs with a description of the new fallback claim property. Here's a link to the docs section I'm referring to: http://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#openid_connect I can give a +1 once this is updated. Thanks! |
nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
Outdated
Show resolved
Hide resolved
...b-security/src/main/java/org/apache/nifi/web/security/oidc/StandardOidcIdentityProvider.java
Outdated
Show resolved
Hide resolved
...b-security/src/main/java/org/apache/nifi/web/security/oidc/StandardOidcIdentityProvider.java
Outdated
Show resolved
Hide resolved
...b-security/src/main/java/org/apache/nifi/web/security/oidc/StandardOidcIdentityProvider.java
Outdated
Show resolved
Hide resolved
.../test/groovy/org/apache/nifi/web/security/oidc/StandardOidcIdentityProviderGroovyTest.groovy
Outdated
Show resolved
Hide resolved
|
@mtien-apache |
|
@mtien-apache @sjyang18 I've been looking at this and was wondering which identity providers this has been tested against? |
|
@jfrazee I have tested this with Azure. I have also verified the functionality and it works as expected. |
|
@jfrazee I tested it with Azure, Google, and Okta. |
|
+1 Reviewed and verified all changes work as expected. Admin doc addition look good. Thank you. |
nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
Outdated
Show resolved
Hide resolved
nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
Outdated
Show resolved
Hide resolved
|
Not sure why do we want to add another property. |
|
@sushilkm I believe |
|
@mtien-apache what i mean to say was instead of adding another property we could make the existing property to behave like that comma-separated value. it should not be breaking change. |
|
@sushilkm I think that's a valid question. I haven't been able to convince myself which configuration experience is the right one. @mcgilman You did a bunch of work on the OIDC code, can you weigh in on this? (I.e., whether it's better for the user to have a distinct fallback claim configuration or to overload/enhance the existing one to be an ordered list.) |
|
There are existing test cases that we need to update if we modify the semantics of existing property, and I choose not to modify existing semantics and logics. |
|
If we had done this from the beginning, I definitely think we should have used a single property with an ordered list of claims, and used "claims" in the name instead of "claim", but since we have the existing property I'm not sure either approach has a major advantage... On one hand, using the existing property is easier for anyone already referencing the property in some way, and it can be done without breaking anything. On the other hand, the work is already done to add the second property, and it does create very specific semantics where the original "claim" property is a single claim, and the second one with "claims" is a list. |
|
Thanks @bbende That's sort of where my head was at. Neither seems like it results in a bad outcome and the current path makes it clear what the additional values are. Provided we make the small change to filter empty values, I'm happy to see this go in. |
| } | ||
|
|
||
| @Test | ||
| void testconvertOIDCTokenToLoginAuthenticationTokenShouldHandleNoEmailClaimHasFallbackClaims() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| void testconvertOIDCTokenToLoginAuthenticationTokenShouldHandleNoEmailClaimHasFallbackClaims() { | |
| @Test | |
| void testConvertOIDCTokenToLoginAuthenticationTokenShouldHandleNoEmailClaimHasFallbackClaims() { |
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (StringUtils.isBlank(identity)) { | ||
| identity = retrieveIdentityFromUserInfoEndpoint(oidcTokens); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This closes apache#4630 Signed-off-by: Joey Frazee <jfrazee@apache.org>
This closes apache#4630 Signed-off-by: Joey Frazee <jfrazee@apache.org>
Thank you for submitting a contribution to Apache NiFi.
Please provide a short description of the PR here:
Description of PR
NIFI-7924: add fallback claims for identifying user
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically
main)?Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not
squashor use--forcewhen pushing to allow for clean monitoring of changes.For code changes:
mvn -Pcontrib-check clean installat the rootnififolder?LICENSEfile, including the mainLICENSEfile undernifi-assembly?NOTICEfile, including the mainNOTICEfile found undernifi-assembly?.displayNamein addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.