Skip to content

NIFI-4889: Logout not working properly with OIDC#2830

Closed
Trojan295 wants to merge 1 commit intoapache:masterfrom
Trojan295:NIFI-4889
Closed

NIFI-4889: Logout not working properly with OIDC#2830
Trojan295 wants to merge 1 commit intoapache:masterfrom
Trojan295:NIFI-4889

Conversation

@Trojan295
Copy link

  • Redirect user agent to end session endpoint on the OIDC provider

Thank you for submitting a contribution to Apache NiFi.

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 master)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

@Trojan295
Copy link
Author

When running the test suite locally I have problems with an dependency:

[ERROR] Failed to execute goal on project nifi-hive-processors: Could not resolve dependencies for project org.apache.nifi:nifi-hive-processors:jar:1.7.0-SNAPSHOT: Could not find artifact org.pentaho:pentaho-aggdesigner-algorithm:jar:5.1.5-jhyde in central (https://repo1.maven.org/maven2) -> [Help 1]

I had to add an additional repository to make it work, although I didn't commit it:

<repository>
    <id>spring-plugins</id>
    <url>http://repo.spring.io/plugins-release</url>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
    <releases>
        <enabled>true</enabled>
    </releases>
</repository>

Could it be, that the artifact was in Maven Central and was moved, but the CI on Travis as it cached in the local repo?

@pvillard31
Copy link
Contributor

@Trojan295 - NiFi 1.7.0 has been released, I'd recommend you to rebase against master (so that all the pom files are updated to 1.8.0-SNAPSHOT) and do a full build to have a clean local maven repo (you shouldn't have 1.7.0-SNAPSHOT anymore). All the Travis builds are OK for your PR so it sounds OK to me.

Regarding the PR itself, I'll let someone like @mcgilman having a look ;)

@Trojan295
Copy link
Author

Rebased from current master

@mcgilman
Copy link
Contributor

Will review...

@mcgilman
Copy link
Contributor

@Trojan295 Thanks for the PR! The code looks good but I ran into an issue when attempting to log out. Despite being a required field in the openid spec [1], it appears that at least in practice [2] the end_session_endpoint field is not guaranteed to be present. I think we may need to account for this possibility in the logout endpoint.

[1] https://openid.net/specs/openid-connect-session-1_0.html#OPMetadata
[2] https://accounts.google.com/.well-known/openid-configuration

@Trojan295
Copy link
Author

I added a fallback to simply redirect back to NiFi in case the end session endpoint isn't present.

Tricky thing is, that NiFi automatically starts an login attempt, when an unauthenticated user accesses NiFi. In case of an IDP like Keycloak, which has the end session endpoint, then after logout the user is redirected back to Keycloaks login page.

In case of Google OpenID he gets redirected to them and the SSO mechanism logs the user again...

- Redirect user agent to end session endpoint on the OIDC provider
@mcgilman
Copy link
Contributor

Looks good @Trojan295. Thanks! This has been merged to master.

@asfgit asfgit closed this in ec7f131 Jul 16, 2018
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.

3 participants