-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
423 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+70.9 KB
docs/developer-guide/integrations/users/img/google-create-credentials.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+50.1 KB
docs/developer-guide/integrations/users/img/kc-configure-mapstore-server.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.4 KB
docs/developer-guide/integrations/users/img/kc-copy-config-server.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.2 KB
docs/developer-guide/integrations/users/img/kc-create-mapstore-server.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions
78
docs/developer-guide/integrations/users/img/mapstore-server.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"clientId": "mapstore-server", | ||
"rootUrl": "http://localhost:8081", | ||
"adminUrl": "", | ||
"baseUrl": "", | ||
"surrogateAuthRequired": false, | ||
"enabled": true, | ||
"alwaysDisplayInConsole": false, | ||
"clientAuthenticatorType": "client-secret", | ||
"redirectUris": [ | ||
"http://localhost:8081/*", | ||
"http://localhost:8082/*" | ||
], | ||
"webOrigins": [ | ||
"" | ||
], | ||
"notBefore": 0, | ||
"bearerOnly": false, | ||
"consentRequired": false, | ||
"standardFlowEnabled": true, | ||
"implicitFlowEnabled": true, | ||
"directAccessGrantsEnabled": true, | ||
"serviceAccountsEnabled": false, | ||
"publicClient": false, | ||
"frontchannelLogout": false, | ||
"protocol": "openid-connect", | ||
"attributes": { | ||
"access.token.lifespan": "300", | ||
"saml.force.post.binding": "false", | ||
"saml.multivalued.roles": "false", | ||
"frontchannel.logout.session.required": "false", | ||
"oauth2.device.authorization.grant.enabled": "false", | ||
"backchannel.logout.revoke.offline.tokens": "false", | ||
"saml.server.signature.keyinfo.ext": "false", | ||
"use.refresh.tokens": "true", | ||
"oidc.ciba.grant.enabled": "false", | ||
"backchannel.logout.session.required": "true", | ||
"client_credentials.use_refresh_token": "false", | ||
"require.pushed.authorization.requests": "false", | ||
"saml.client.signature": "false", | ||
"saml.allow.ecp.flow": "false", | ||
"id.token.as.detached.signature": "false", | ||
"saml.assertion.signature": "false", | ||
"client.secret.creation.time": "1655740901", | ||
"saml.encrypt": "false", | ||
"saml.server.signature": "false", | ||
"exclude.session.state.from.auth.response": "false", | ||
"saml.artifact.binding": "false", | ||
"saml_force_name_id_format": "false", | ||
"acr.loa.map": "{}", | ||
"tls.client.certificate.bound.access.tokens": "false", | ||
"saml.authnstatement": "false", | ||
"display.on.consent.screen": "false", | ||
"token.response.type.bearer.lower-case": "false", | ||
"saml.onetimeuse.condition": "false" | ||
}, | ||
"authenticationFlowBindingOverrides": {}, | ||
"fullScopeAllowed": true, | ||
"nodeReRegistrationTimeout": -1, | ||
"defaultClientScopes": [ | ||
"web-origins", | ||
"acr", | ||
"roles", | ||
"profile", | ||
"email" | ||
], | ||
"optionalClientScopes": [ | ||
"address", | ||
"phone", | ||
"offline_access", | ||
"microprofile-jwt" | ||
], | ||
"access": { | ||
"view": true, | ||
"configure": true, | ||
"manage": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
# Integration with OpenID connect | ||
|
||
MapStore allows to integrate and login using some common [OpenID connect](https://openid.net/connect/) services. Having this support properly configured, you can make MapStore users able to login with the given OpenID service. | ||
|
||
## Customizing logo an text in Login Form | ||
|
||
For details about the configuration for a specific service, please refer to the specific section below. For details about `authenticationProviders` optional values (e.g. to customize icon and/or text to show), refer to the documentation of the [LoginPlugin](https://mapstore.geosolutionsgroup.com/mapstore/docs/api/plugins#plugins.Login). | ||
|
||
By default `authenticationProviders` is `{"type": "basic", "provider": "geostore"}`, that represents the standard login on **MapStore** with username and password. With the default configuration, when the user try to login, MapStore will show the classic login form. | ||
|
||
It is possible to add other providers to the list (e.g. `openid`) and they will be added as options to the login window. | ||
You can remove the `geostore` entry from `authenticationProviders` list to remove the login form from the possible login systems. | ||
|
||
!!! note | ||
If only one OpenID entry is present in `authenticationProviders` (and no `geostore` entry available), clicking on login in the login menu will not show any intermediate window and you will be redirected directly to the OpenID provider configured. If more than one entry is present in `authenticationProviders` list, the user will have to choose one of them to be authenticated. | ||
|
||
## Supported OpenID services | ||
|
||
MapStore allows to integrate with the following OpenID providers. | ||
|
||
- Keycloak | ||
|
||
For each service you want to add you have to: | ||
|
||
- properly configure the backend | ||
- modify `localConfig.json` adding a proper entry to the `authenticationProviders`. | ||
|
||
!!! note | ||
For the moment we can configure only one authentication per service type (only one for google, only one for keycloak ...). | ||
|
||
|
||
#### Create Oauth 2.0 credentials on Google Console | ||
|
||
In order to setup the openID connection you have to setup a project in Google API Console to obtain Oauth 2.0 credentials and configure them. | ||
|
||
- Open Google developer console and, from credentials section, create a new credential of type **Oauth client ID** | ||
|
||
<img src="../img/google-create-credentials.jpg" class="ms-docimage" style="max-width:500px;"/> | ||
|
||
- Set the **Application Type** to **Web Application**, name it as you prefer and configure the root of the application as an authorized redirect URI. Then click on **Create** | ||
|
||
<img src="../img/google-create-oauth2.jpg" class="ms-docimage" style="max-width:500px;"/> | ||
|
||
- After creation you will obtain **ClientID** and **Client Secret** to use to configure MapStore. | ||
|
||
Please follow the [Google documentation](https://developers.google.com/identity/protocols/oauth2/openid-connect) for any detail or additional configuration. | ||
|
||
#### Configure MapStore back-end for Google OpenID | ||
|
||
After the setup, you will have to: | ||
|
||
- create/edit `mapstore-ovr.properties` file (in data-dir or class path) to configure the google provider this way: | ||
|
||
```properties | ||
|
||
# enables the google OpenID Connect filter | ||
googleOAuth2Config.enabled=true | ||
|
||
#clientId and clientSecret | ||
googleOAuth2Config.clientId=<the_client_id_from_google_dev_console> | ||
googleOAuth2Config.clientSecret=<the_client_secret_from_google_dev_console> | ||
|
||
# create the user if not present | ||
googleOAuth2Config.autoCreateUser=true | ||
|
||
# Redirect URL | ||
googleOAuth2Config.redirectUri=https://<your-appliction-domain>/mapstore/rest/geostore/openid/google/callback | ||
# Internal redirect URI (you can set it to relative path like this `../../..` to make this config work across domain) | ||
googleOAuth2Config.internalRedirectUri=https://<your-appliction-domain>/mapstore/ | ||
|
||
## discoveryUrl: contains all the information for the specific service. | ||
googleOAuth2Config.discoveryUrl=https://accounts.google.com/.well-known/openid-configuration | ||
#If the `discoveryUrl` has not been specified, you can manually configure the following options. | ||
``` | ||
|
||
#### Configure MapStore front-end for Google OpenID | ||
|
||
- Add an entry for `google` in `authenticationProviders` inside `localConfig.json` file. | ||
|
||
```json | ||
{ | ||
"authenticationProviders": [ | ||
{ | ||
"type": "openID", | ||
"provider": "google" | ||
}, | ||
{ | ||
"type": "basic", | ||
"provider": "geostore" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Keycloak | ||
|
||
[Keycloak](https://www.keycloak.org/) is an open source identity and access management application widely used. MapStore has the ability to integrate with keycloak: | ||
|
||
- Using the standard OpenID protocol | ||
- Supporting SSO (not yet implemented) | ||
- Integrating with users and roles, as well as for ldap. (not yet implemented) | ||
|
||
In this section you can see how to configure keycloak as a standard OpenID provider | ||
|
||
#### Configure keycloak Client | ||
|
||
Create a new Client on keycloak. In this guide we will name it `mapstore-server` (because if you need to configure SSO, we may need another key to call `mapstore-client`) | ||
|
||
<img src="../img/kc-create-client.jpg" class="ms-docimage" style="max-width:500px;"/> | ||
<img src="../img/kc-create-mapstore-server.jpg" class="ms-docimage" style="max-width:500px;"/> | ||
|
||
- Configure it as `Confidential` setting the Redirect-URL with your MapStore base root, with a `*` at the end (e.g. `https://my.mapstore.site.com/mapstore/*`) | ||
|
||
<img src="../img/kc-configure-mapstore-server.jpg" class="ms-docimage" style="max-width:500px;"/> | ||
|
||
- Click on Save button, then open the *Installation* tab, select the `Keycloak OIDC JSON` format, and copy the JSON displayed below. | ||
|
||
<img src="../img/kc-copy-config-server.jpg" class="ms-docimage" style="max-width:500px;"/> | ||
|
||
### Configure MapStore back-end for Keycloak OpenID | ||
|
||
- create/edit `mapstore-ovr.properties` file (in data-dir or class path) to configure the keycloak provider this way: | ||
- `keycloakOAuth2Config.jsonConfig`: insert the JSON copied, removing all the spaces | ||
- `keycloakOAuth2Config.redirectUri`: need to be configured to point to your application at the path `<base-app-url>/rest/geostore/openid/keycloak/callback`, e.g. `https://my.mapstore.site.com/mapstore/rest/geostore/openid/keycloak/callback` | ||
- `keycloakOAuth2Config.internalRedirectUri` can be set to your application root, e.g. `https://my.mapstore.site.com/mapstore/` | ||
- `keycloakOAuth2Config.autoCreateUser`: true if you want to create user on DB on login (if you are not using any other user integration e.g. `ldap`, `keycloak`) | ||
|
||
```properties | ||
# enables the keycloak OpenID Connect filter | ||
keycloakOAuth2Config.enabled=false | ||
|
||
# Configuration | ||
keycloakOAuth2Config.jsonConfig=<copy-here-the-json-config-from-keycloak-removing-all-the-spaces> | ||
|
||
|
||
# Redirect URLs | ||
# - Redirect URL: need to be configured to point to your application at the path <base-app-url>/rest/geostore/openid/keycloak/callback | ||
# e.g. `https://my.mapstore.site.com/mapstore/mapstore/rest/geostore/openid/keycloak/callback` | ||
keycloakOAuth2Config.redirectUri=https://localhost:9191/mapstore/rest/geostore/openid/keycloak/callback | ||
# - Internal redirect URL when logged in (typically the home page of MapStore, can be relative) | ||
keycloakOAuth2Config.internalRedirectUri=https://my.mapstore.site.com/mapstore/ | ||
|
||
# Create user (if you are using local database, this should be set to true) | ||
keycloakOAuth2Config.autoCreateUser=true | ||
|
||
``` | ||
|
||
#### Configure MapStore front-end for Keycloak OpenID | ||
|
||
- Add an entry for `keycloak` in `authenticationProviders` inside `localConfig.json` file. | ||
|
||
```json | ||
{ | ||
"authenticationProviders": [ | ||
{ | ||
"type": "openID", | ||
"provider": "keycloak" | ||
}, | ||
{ | ||
"type": "basic", | ||
"provider": "geostore" | ||
} | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.