NIFI-7584 Added OIDC logout mechanism.#4593
NIFI-7584 Added OIDC logout mechanism.#4593mtien-apache wants to merge 6 commits intoapache:mainfrom
Conversation
Added method to validate the OIDC Access Token for the revoke endpoint. Created a new callback URI of oidc/logoutCallback to handle certain OIDC logout cases. Changed method to exchange the Authorization Code for a Login Authentication Token. Added a new method to exchange the AuthN Code for an Access Token. Changed method to convert OIDC Token to a Login AuthN Token instead of a NiFi JWT. Created new OidcServiceGroovyTest class.
|
Reviewing |
|
To test this, be sure to add the following redirect URI's to your Identity Provider's authorized redirect URI's list:
Depending on your ID Provider, you may need to add NiFi's home and the new logout page URI's:
|
|
Tested this out with Google Suite and Microsoft Azure, was able to log out successfully. G Suite redirected back to the logout page of NiFi, and Azure presented a logout page to choose the user to log out and then a success page. Confirmed the NiFi JWT was invalidated in both cases. |
|
Looks like some issues with the style checker on line lengths in the Github Actions tests. |
|
@thenatog I fixed the issue. Thanks for reviewing. |
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml
Outdated
Show resolved
Hide resolved
...fi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessResource.java
Show resolved
Hide resolved
...fi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessResource.java
Show resolved
Hide resolved
...fi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessResource.java
Show resolved
Hide resolved
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml
Outdated
Show resolved
Hide resolved
...fi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessResource.java
Outdated
Show resolved
Hide resolved
...fi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessResource.java
Outdated
Show resolved
Hide resolved
...fi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessResource.java
Outdated
Show resolved
Hide resolved
...fi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessResource.java
Outdated
Show resolved
Hide resolved
...b-security/src/main/java/org/apache/nifi/web/security/oidc/StandardOidcIdentityProvider.java
Outdated
Show resolved
Hide resolved
...-web-security/src/test/groovy/org/apache/nifi/web/security/oidc/OidcServiceGroovyTest.groovy
Show resolved
Hide resolved
...-web-security/src/test/groovy/org/apache/nifi/web/security/oidc/OidcServiceGroovyTest.groovy
Outdated
Show resolved
Hide resolved
...fi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessResource.java
Show resolved
Hide resolved
Refactored revoke endpoint POST request to a private method. Removed unnecessary dependencies. Fixed Regex Pattern to search for literal dot character. Fixed logging the Exception message. Fixed caught Exception. Changed timeout value to a static variable. Changed repeating error messages to a static string. Reduced sleep duration in unit test. Refactored cookie generation to private method.
|
Retested with changes, looks good to me. +1 will merge, thanks for a great contribution. |
Added method to validate the OIDC Access Token for the revoke endpoint. Created a new callback URI of oidc/logoutCallback to handle certain OIDC logout cases. Changed method to exchange the Authorization Code for a Login Authentication Token. Added a new method to exchange the AuthN Code for an Access Token. Changed method to convert OIDC Token to a Login AuthN Token instead of a NiFi JWT. Created new OidcServiceGroovyTest class. NIFI-7584-rebase Added test. NIFI-7584 Fixed a checkstyle issue. NIFI-7584 Removed a dependency not in use. NIFI-7584 Made revisions based on PR review. Refactored revoke endpoint POST request to a private method. Removed unnecessary dependencies. Fixed Regex Pattern to search for literal dot character. Fixed logging the Exception message. Fixed caught Exception. Changed timeout value to a static variable. Changed repeating error messages to a static string. Reduced sleep duration in unit test. Refactored cookie generation to private method. NIFI-7584 Fixed the snapshot version. Signed-off-by: Nathan Gough <thenatog@gmail.com> This closes apache#4593.
Added method to validate the OIDC Access Token for the revoke endpoint. Created a new callback URI of oidc/logoutCallback to handle certain OIDC logout cases. Changed method to exchange the Authorization Code for a Login Authentication Token. Added a new method to exchange the AuthN Code for an Access Token. Changed method to convert OIDC Token to a Login AuthN Token instead of a NiFi JWT. Created new OidcServiceGroovyTest class. NIFI-7584-rebase Added test. NIFI-7584 Fixed a checkstyle issue. NIFI-7584 Removed a dependency not in use. NIFI-7584 Made revisions based on PR review. Refactored revoke endpoint POST request to a private method. Removed unnecessary dependencies. Fixed Regex Pattern to search for literal dot character. Fixed logging the Exception message. Fixed caught Exception. Changed timeout value to a static variable. Changed repeating error messages to a static string. Reduced sleep duration in unit test. Refactored cookie generation to private method. NIFI-7584 Fixed the snapshot version. Signed-off-by: Nathan Gough <thenatog@gmail.com> This closes apache#4593.
Added method to validate the OIDC Access Token for the revoke endpoint. Created a new callback URI of oidc/logoutCallback to handle certain OIDC logout cases. Changed method to exchange the Authorization Code for a Login Authentication Token. Added a new method to exchange the AuthN Code for an Access Token. Changed method to convert OIDC Token to a Login AuthN Token instead of a NiFi JWT. Created new OidcServiceGroovyTest class. NIFI-7584-rebase Added test. NIFI-7584 Fixed a checkstyle issue. NIFI-7584 Removed a dependency not in use. NIFI-7584 Made revisions based on PR review. Refactored revoke endpoint POST request to a private method. Removed unnecessary dependencies. Fixed Regex Pattern to search for literal dot character. Fixed logging the Exception message. Fixed caught Exception. Changed timeout value to a static variable. Changed repeating error messages to a static string. Reduced sleep duration in unit test. Refactored cookie generation to private method. NIFI-7584 Fixed the snapshot version. Signed-off-by: Nathan Gough <thenatog@gmail.com> This closes apache#4593.
Added method to validate the OIDC Access Token for the revoke endpoint. Created a new callback URI of oidc/logoutCallback to handle certain OIDC logout cases. Changed method to exchange the Authorization Code for a Login Authentication Token. Added a new method to exchange the AuthN Code for an Access Token. Changed method to convert OIDC Token to a Login AuthN Token instead of a NiFi JWT. Created new OidcServiceGroovyTest class. NIFI-7584-rebase Added test. NIFI-7584 Fixed a checkstyle issue. NIFI-7584 Removed a dependency not in use. NIFI-7584 Made revisions based on PR review. Refactored revoke endpoint POST request to a private method. Removed unnecessary dependencies. Fixed Regex Pattern to search for literal dot character. Fixed logging the Exception message. Fixed caught Exception. Changed timeout value to a static variable. Changed repeating error messages to a static string. Reduced sleep duration in unit test. Refactored cookie generation to private method. NIFI-7584 Fixed the snapshot version. Signed-off-by: Nathan Gough <thenatog@gmail.com> This closes apache#4593.
Added method to validate the OIDC Access Token for the revoke endpoint.
Created a new callback URI of oidc/logoutCallback to handle certain OIDC logout cases.
Changed method to exchange the Authorization Code for a Login Authentication Token.
Added a new method to exchange the AuthN Code for an Access Token.
Changed method to convert OIDC Token to a Login AuthN Token instead of a NiFi JWT.
Created new OidcServiceGroovyTest class.
Thank you for submitting a contribution to Apache NiFi.
Please provide a short description of the PR here:
Description of PR
Enables X functionality; fixes bug NIFI-YYYY.
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.