Skip to content

Commit

Permalink
update documentation with github login
Browse files Browse the repository at this point in the history
  • Loading branch information
david-blasby committed Dec 11, 2024
1 parent 24b8edc commit af3390d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
52 changes: 49 additions & 3 deletions docs/manual/docs/GN4-Integration/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@
# GeoNetwork 5 Integration with GeoNetwork 4 {#toc}

There are two main ways handle authentication between GN5 and GN4.
During the development of GN5, GN4 will be used for some of the GN functionality. GN5 will route some
requests to a GN4 instance (connected to the same DB and Elastic Index) for processing.


## Setting up GN5 and GN4

1. Configure GN5 (`application.yml`) so that the `cloud: gateway: mvc:` configuration points to your GN4
2. Ensure that GN4 is setup to be proxied:

a) Go the GN4's settings ("Catalog server" section) <br>
b) Set this section up so it will create urls that will be correctly routed through GN5 (ie. use GN5's hostname and port)<br>
c) Your GN4's path should be the same as the GN5's proxy path. This will ensure that GN4's session cookies are correctly maintained<br>
For example, GN5's proxy at `http://<host>:<port>/geonetwork` and GN4 at `http://<other host>:<other port>/geonetwork`<br>
(both at `/geonetwork`)

3. Configure GN4 with JWT Headers Security and add the GN5 `application.yml` `cloud: gateway: mvc:` filter.

a) [Simple Authentication](auth-json.md) <br>
b) [JWT-Based Authentication](auth-jwt.md)

You will manage users in the GN database.

## Using GitHub OIDC Authentication

Typically, you would use the standard username/password authentication thats built into GN5. However, GitHub authentication is also available.

1. Create a GitHub application (this will give you a `clientId`). Got to https://github.com/settings/profile then "Developer settings" (left column) then "OAuth Apps" (left column). See online tutorials on how to create one.
* "Authorization callback URL" - http://localhost:7979/login/oauth2/code/github (use your GN5's host address)
2. Create a GitHub clientSecret (this will give you a `clientSecret`)
3. Add the `clientId` and `clientSecret` to GN5's `application.yml` section `security: oauth2: client: registration: github:`

* fill in the `clientId:` and `clientSecret:` sections

```yml
security:
oauth2:
client:
registration:
github:
clientId: ...from your GitHub application...
clientSecret: ...from your GitHub application...
```
Once the user logs into GN5, it will create a user in the database. The username will either be their email (if they have configured GitHub to have their email address public) or their GitHub username.
Use the tools in the GN Administration -> "Users and Groups" to set the user's permissions.
1. [Simple Authentication](auth-json.md)
1. [JWT-Based Authentication](auth-jwt.md)
2 changes: 1 addition & 1 deletion docs/manual/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ Welcome to GeoNetwork 5.

---

Authentication passing between GN5 and GN5 via the proxy gateway.
Integrating GN5 and GN4 via the proxy gateway.
</div>

0 comments on commit af3390d

Please sign in to comment.