Skip to content

Link within approval email does not work for oauth providers. #6934

Description

@ianwallen

Describe the bug
The link within the approver email does not work if using external authentication.

To Reproduce

  • Configure catalogue so that it uses keycloak or openidconnect provider
  • Create a record with workflow enabled and request approval (ensure that email was delivered with link)
  • Logout or close browser.
  • Click on link from email - it will not go to the metadata record page - instead it will go to the catalogue home page.

Expected behavior
Expecting the link to work as intended.

Desktop (please complete the following information):

  • Browser: Edge
  • GeoNetwork Version: 3.12.8
  • Server Application: Tomcat 9 with Java 8

Additional context
The issue is that the redirect email tries to go to a url similar to the following
http://localhost:8080/geonetwork/srv/eng/catalog.search#/metadata/e3b63ab5-c277-4dd8-8cff-ee78555bd809
But as the user is not logged in the authentication will redirect the user to the oauth application (i.e. keycloak). The redirect will not contain the anchor "#/metadata/e3b63ab5-c277-4dd8-8cff-ee78555bd809" because the redirect is generated from the server and is not available - it is only available to the browser. The browser will detect that the redirect is to a different host so it will not include the anchor. So after the login the user goes to http://localhost:8080/geonetwork/srv/eng/catalog.search which is not the intended location.

Suggesting that the link get changed to the following
http://localhost:8080/geonetwork?uuid=e3b63ab5-c277-4dd8-8cff-ee78555bd809
Which should fix the issue.

Note that this issue may apply in other links applied to the catalogue - I'm not sure where all occurrences may be?
Also this issue is also affecting users bookmarking the urls to metadata records for the same issue. The only time the books marks wil work is when the user is already logged in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions