Skip to content

Commit 09c0b79

Browse files
authored
Release 6.2.10 (#196)
* set core release version 6.2.10 * changelog and readme typo [skip ci] * [service] upgrade passport-ldapauth * add docker service and docs for ldap idp and move auth documentation to its own file * [service] update engines versions in package.json [skip ci]
1 parent a973f41 commit 09c0b79

File tree

16 files changed

+320
-376
lines changed

16 files changed

+320
-376
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ pnpm-debug.log
1515
scratch/
1616
*.scratch/
1717
*.scratch.*
18+
/docker/auth-idp/ldap/config/*
19+
/docker/auth-idp/ldap/db/*
20+
# this line must be last
21+
!.gitkeep

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ MAGE adheres to [Semantic Versioning](http://semver.org/).
1818
the `options` entry. See the related bug fix below.
1919

2020
#### Features
21+
* Admins can now configure different placename search services in settings.
2122
* Layer file download - The _Layer_ admin web page now includes a button to
2223
download layer files when applicable. This currently works only for
2324
GeoPackage layers.
@@ -26,7 +27,14 @@ MAGE adheres to [Semantic Versioning](http://semver.org/).
2627
* The web app and service incorrectly used a `settings.options` sub-document on
2728
SAML configurations to read and write some entries that should be in the
2829
`settings` entry.
30+
* Admin user search could crash the server when sending certain characters.
31+
* Feed item timestamps appeared as epoch milliseconds rather than formatted dates.
2932
* Many third-party dependencies were quite outdated or superfluous.
33+
* Fortify static code analysis had findings that were addressed.
34+
* GeoPackage and CSV exports had several null reference bugs.
35+
* Some TypeScript DTS files for plain JS files were incorrect or incomplete.
36+
* The ready event for app startup was emitting before the HTTP server was actually listening.
37+
* The service configuration did not allow a port value of `0`, which prompts the HTTP server to pick a random open port. This helps with testing.
3038

3139
## [6.2.9](https://github.com/ngageoint/mage-server/releases/tag/6.2.9)
3240

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ npm run build
283283
After building the core packages, install them as dependencies in the `instance` package.
284284
```bash
285285
cd instance
286-
npm i --omit=dev ../service ../web-app ../plugins/nga-msi
286+
npm i --omit dev ../service ../web-app ../plugins/nga-msi
287287
```
288288
The project's root [`package.json`](./package.json) provides some convenience script entries to install, build, and run
289289
the MAGE server components, however, those are deprecated and will likely go away after migrating to NPM 7+'s

docker/auth-idp/docker-compose.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
services:
2+
23
mage-idp-saml:
34
container_name: mage-idp-saml
45
image: kristophjunge/test-saml-idp
@@ -14,3 +15,40 @@ services:
1415
source: ./saml/authsources.php
1516
target: /var/www/simplesamlphp/config/authsources.php
1617

18+
mage-idp-ldap:
19+
container_name: mage-idp-ldap
20+
image: osixia/openldap:1.5.0
21+
environment:
22+
- "LDAP_ORGANISATION=World's Greatest Detectives Inc."
23+
- "LDAP_DOMAIN=wgd.com"
24+
- "LDAP_ADMIN_PASSWORD=i found something"
25+
ports:
26+
- 389:389
27+
- 636:636
28+
volumes:
29+
- type: bind
30+
source: ./ldap/db
31+
target: /var/lib/ldap
32+
- type: bind
33+
source: ./ldap/config
34+
target: /etc/ldap/slapd.d
35+
networks:
36+
- ldap.mage.net
37+
38+
mage-idp-ldap-ui:
39+
container_name: mage-idp-ldap-ui
40+
image: osixia/phpldapadmin:latest
41+
depends_on:
42+
- mage-idp-ldap
43+
environment:
44+
- PHPLDAPADMIN_LDAP_HOSTS=mage-idp-ldap
45+
ports:
46+
- 6480:80
47+
- 6443:443
48+
networks:
49+
- ldap.mage.net
50+
51+
networks:
52+
ldap.mage.net:
53+
driver: bridge
54+

docker/auth-idp/ldap/config/.gitkeep

Whitespace-only changes.

docker/auth-idp/ldap/db/.gitkeep

Whitespace-only changes.

docs/admin.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/admin/auth.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# MAGE Authentication and Identity Providers
2+
3+
To configure authentication settings and identity providers
4+
1. Click the gear icon in the upper right of the MAGE web app to load the _Admin_ page.
5+
1. Click, the _Settings_ tab in the tab strip on the left of the page.
6+
1. Click the _Authentication_ tab near the top of the main content pane. This tab should be selected by default.
7+
1. Click any of the accordion headings to expand the section for the authentication you want to configure, or
8+
click the _New Authentication_ button to add a new authentication identity provider.
9+
10+
## Local
11+
12+
## OAuth 2.0
13+
14+
Here is an example of using Google's OAuth 2.0 [endpoints](https://developers.google.com/identity/gsi/web/guides/overview) to authenticate MAGE
15+
users. This setup is very similar to Google OpenID Connect authentication.
16+
17+
Obtain your _Client Identifier_ and _Client Secret_ from Google's [API Console](https://console.cloud.google.com/apis/credentials/oauthclient).
18+
Additionally on that page, ensure you register the correct callback URL, e.g., `https://mage.example.com/auth/oauth/callback`
19+
20+
On the MAGE Admin page, click the _Settings_ tab.
21+
22+
_Authorization URL_ - `https://accounts.google.com/o/oauth2/v2/auth`
23+
_Token URL_ - `https://oauth2.googleapis.com/token`
24+
_User Profile URL_ - `https://www.googleapis.com/oauth2/v3/userinfo`
25+
_Scopes_ - `profile,email,openid`
26+
27+
Click the _Advanced_ section header to expand the advanced settings panel.
28+
_Profile ID Property_ - `sub`
29+
_Display Name Property_ - `name`
30+
31+
## LDAP
32+
33+
You can setup MAGE to authenticate users with an LDAP server. For development
34+
testing, the [`auth-idp`](../docker/auth-idp/docker-compose.yml) Compose file
35+
uses the [osixia/openldap](https://github.com/osixia/docker-openldap) and
36+
[osixia/phpLDAPAdmin](https://github.com/osixia/docker-phpLDAPAdmin) images
37+
for LDAP services. Start the `mage-idp-ldap` and `mage-idp-ldap-ui` LDAP
38+
services with the following commands.
39+
```bash
40+
cd docker/auth-idp
41+
docker compose up -d mage-idp-ldap mage-idp-ldap-ui
42+
```
43+
You can interact with the LDAP admin UI by browsing to https://localhost:6443.
44+
You'll need to by-pass your browser's warning about a self-signed certificate.
45+
Click the _Login_ link on the left pane. The root user name and password for
46+
the LDAP server are `cn=admin,dc=wgd,dc=com` and `i found something`,
47+
respectively.
48+
49+
You can then use the phpLDAPAdmin UI to setup a simple group structure.
50+
1. Click the _dc=wgd,dc=com_ root node in the tree view on the left of the page.
51+
1. In the main pane, click _Create a child entry_.
52+
1. Select the _Generic: Posix Group_ template.
53+
1. Enter a name for the group in the _Group_ field, e.g., `Field Agents`.
54+
1. Click the _Create Object_ button, then click the _Commit_ button on the next page.
55+
1. Click the root node again in the tree view.
56+
1. Click _Create a child entry_ in the main pane.
57+
1. Select the _Generic: Organizational Unit_ template.
58+
1. Enter a name in the _Organizational Unit_ field, e.g., `Field Agents`.
59+
1. Click the _Create Object_ button, then click the _Commit_ button on the next page.
60+
1. The main pane should now display the organization unit you just created.
61+
1. Click _Create a child entry_ in the main pane.
62+
1. Select the _Generic: User Account_ template.
63+
1. Fill the form fields, e.g.,
64+
65+
| | |
66+
| ---: | --- |
67+
| _First Name_ | `Bruce`|
68+
| _Last Name_ | `Wayne` |
69+
| _Common Name_ | `Batman` |
70+
| _User ID_ | `batman` |
71+
| _Password_ | `i heart alfred` |
72+
| _GID Number_ | `Field Agents` |
73+
74+
1. Click the _Create Object_ button, then click the _Commit_ button on the next page.
75+
You now have a simple group structure and user account in your LDAP database.
76+
77+
Now that you have an LDAP database with a user account, you can configure LDAP
78+
authentication in MAGE. This assumes you're running a MAGE server on
79+
http://localhost:4242.
80+
1. Open the MAGE web app in your browser.
81+
1. Click the gear icon in the top right to load the _Admin_ page.
82+
1. Click the _Settings_ tab in the vertical tab strip on the left.
83+
1. The _Authentication_ tab in the main pane should already be active. Click
84+
the tab if not.
85+
1. Click the _New Authentication_ button.
86+
1. Enter a title for the authentication IDP, e.g. `Test LDAP`.
87+
1. Click the _Next_ button.
88+
1. Select `LDAP` from the _Choose a type_ drop-down.
89+
1. Click the _Next_ button.
90+
1. Fill the fields on the _Settings_ step as follows.
91+
| | |
92+
| ---: | ---|
93+
| **_Server_** |
94+
| _URL_ | `ldap://localhost:389` |
95+
| **_Authentication_** |
96+
| _Bind DN_ | `cn=admin,dc=wgd,dc=com` |
97+
| _Bind Credentials_ | `i found something` |
98+
| **_User Search_** |
99+
| _Search Base_ | `ou=Field Agents,dc=wgd,dc=com` |
100+
| _Search Filter_ | `(uid={{username}})` |
101+
| _Search Scope_ | `one` |
102+
| **_Advanced_** |
103+
| _Profile ID Property_ | `uid |
104+
| _Display Name Property_ | `cn` |
105+
1. Click the _Next_ button.
106+
1. Adjust the color settings to your preference.
107+
1. Click the _Next_ button.
108+
1. Review the settings and click the _Save_ button.
109+
1. Open a new private browser tab or window and load your MAGE server web app.
110+
1. The sign-in page should display a button labeled _SIGN IN WITH LOCAL LDAP_
111+
under two text fields.
112+
1. In the _Local LDAP Username_ text field, enter `batman`.
113+
1. In the _Local LDAP Password_ text field, enter `i heart alfred`.
114+
1. Click the _SIGN IN WITH LOCAL LDAP_ button.
115+
1. The page will most likely display a dialog that states the account needs
116+
admin approval.
117+
1. In the browser tab with your MAGE admin page, click the _Users_ tab in the
118+
tab strip on the left.
119+
1. Click the _Inactive_ search facet near the top left of the main pane. The
120+
user list should contain the _Batman_ user with a green _Activate_ button.
121+
1. Click the _Activate_ button next to the _Batman_ user.
122+
1. Return to the private browser tab where you initially signed in with the
123+
LDAP account.
124+
1. Ensure the LDAP username and password fields are still filled, then click
125+
the _SIGN IN WITH LOCAL LDAP_ button.
126+
1. The app may prompt for a device UID if your settings dictate. Enter the
127+
device UID.
128+
1. You are now authenticated with your LDAP account.

instance/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngageoint/mage.dev-instance",
3-
"version": "6.2.10-beta.3",
3+
"version": "6.2.10",
44
"description": "Assemble a MAGE Server deployment from the core service, the web-app, and selected plugins. This is primarily a development tool because the dependencies point to relative directories instead of production packages. This can however serve as a starting point to create a production MAGE instance package.json.",
55
"scripts": {
66
"start": "npm run start:dev-env",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)