Skip to content

Conversation

fxprunayre
Copy link
Member

@fxprunayre fxprunayre commented Aug 8, 2025

Currently, when deploying GeoNetwork 5 with GeoNetwork 4 sign in operation are managed by version 5. This adds the possibility to sign in from GeoNetwork 4 directly.

Configuration steps for GN4 are:

  • start with
    -Dgeonetwork.security.type=gn5
    -Dlogout.success.url=http://localhost:7979/geonetwork/srv/eng/catalog.search
    -DloginForm=http://localhost:7979/geonetwork/srv/eng/catalog.signin
    -DloginErrorForm=http://localhost:7979/geonetwork/srv/eng/catalog.signin?failure=true
  • (optionnaly, if not set using env variables) In config-security.properties, configure the URLs for login and logout to point to GN5:
logout.success.url=http://localhost:7979/geonetwork/srv/eng/catalog.search
loginForm=http://localhost:7979/geonetwork/srv/eng/catalog.signin
loginErrorForm=http://localhost:7979/geonetwork/srv/eng/catalog.signin?failure=true
  • In UI configuration, enable the authentication and set the signin/signout URLs to use the GN5 URLs:
     "authentication": {
          "enabled": true,
          "signinUrl": "../../{{node}}/{{lang}}/catalog.signin",
          "signinAPI": "../../api/user/signin",
          "signoutUrl": "../../api/user/signout"

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

Currently, when deploying GeoNetwork 5 with GeoNetwork 4 sign in operation are managed by version 5. This adds the possibility to sign in from GeoNetwork 4 directly.

Configuration steps for GN4 are:

* start with `-Dgeonetwork.security.type=gn5`
* In `config-security.properties`, configure the URLs for login and logout to point to GN5 (this could maybe be avoided with X-Forwarded headers?):

```properties
logout.success.url=http://localhost:7979/geonetwork/srv/eng/catalog.search
loginForm=http://localhost:7979/geonetwork/srv/eng/catalog.signin
loginErrorForm=http://localhost:7979/geonetwork/srv/eng/catalog.signin?failure=true
```

* In UI configuration, enable the authentication and set the signin/signout URLs to use the GN5 URLs:

```json
     "authentication": {
          "enabled": true,
          "signinUrl": "../../{{node}}/{{lang}}/catalog.signin",
          "signinAPI": "../../api/user/signin",
          "signoutUrl": "../../api/user/signout"
```
Copy link

sonarqubecloud bot commented Aug 8, 2025

Copy link
Contributor

@PascalLike PascalLike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with geonetwork/geonetwork#82 and it looks good

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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