2018-03-20 14:44:01 +01:00
|
|
|
Authentication guide - SAML (OneLogin)
|
|
|
|
===
|
|
|
|
|
2019-03-31 20:10:32 +02:00
|
|
|
**Note:** *This guide was written before the renaming. Just replace `HackMD` with `CodiMD` in your mind :smile: thanks!*
|
2018-06-24 14:04:35 +02:00
|
|
|
|
2018-03-20 14:44:01 +01:00
|
|
|
1. Sign-in or sign-up for an OneLogin account. (available free trial for 2 weeks)
|
|
|
|
2. Go to the administration page.
|
2019-03-31 20:10:32 +02:00
|
|
|
3. Select the **APPS** menu and click on the **Add Apps**.
|
|
|
|

|
2018-03-20 14:44:01 +01:00
|
|
|
|
2019-03-31 20:10:32 +02:00
|
|
|
4. Find "SAML Test Connector (SP)" for template of settings and select it.
|
|
|
|

|
2018-03-20 14:44:01 +01:00
|
|
|
|
2019-03-31 20:10:32 +02:00
|
|
|
5. Edit display name and icons for OneLogin dashboard as you want, and click **SAVE**.
|
|
|
|

|
2018-03-20 14:44:01 +01:00
|
|
|
|
|
|
|
6. After that other tabs will appear, click the **Configuration**, and fill out the below items, and click **SAVE**.
|
2019-03-31 20:10:32 +02:00
|
|
|
* RelayState: The base URL of your CodiMD, which is issuer. (last slash is not needed)
|
|
|
|
* ACS (Consumer) URL Validator: The callback URL of your CodiMD. (serverurl + /auth/saml/callback)
|
2018-03-20 14:44:01 +01:00
|
|
|
* ACS (Consumer) URL: same as above.
|
2019-03-31 20:10:32 +02:00
|
|
|
* Login URL: login URL(SAML requester) of your CopiMD. (serverurl + /auth/saml)
|
|
|
|

|
2018-03-20 14:44:01 +01:00
|
|
|
|
|
|
|
7. The registration is completed. Next, click **SSO** and copy or download the items below.
|
|
|
|
* X.509 Certificate: Click **View Details** and **DOWNLOAD** or copy the content of certificate ....(A)
|
2019-03-31 20:10:32 +02:00
|
|
|
* SAML 2.0 Endpoint (HTTP): Copy the URL ....(B)
|
|
|
|

|
2018-03-20 14:44:01 +01:00
|
|
|
|
2019-03-31 20:10:32 +02:00
|
|
|
8. In your CodiMD server, create IdP certificate file from (A)
|
2018-03-20 14:44:01 +01:00
|
|
|
9. Add the IdP URL (B) and the Idp certificate file path to your config.json file or pass them as environment variables.
|
2019-03-31 20:10:32 +02:00
|
|
|
* `config.json`:
|
|
|
|
```javascript
|
2018-03-20 14:44:01 +01:00
|
|
|
{
|
|
|
|
"production": {
|
|
|
|
"saml": {
|
|
|
|
"idpSsoUrl": "https://*******.onelogin.com/trust/saml2/http-post/sso/******",
|
|
|
|
"idpCert": "/path/to/idp_cert.pem"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-03-31 20:10:32 +02:00
|
|
|
```
|
2018-03-20 14:44:01 +01:00
|
|
|
* environment variables
|
2019-03-31 20:10:32 +02:00
|
|
|
```sh
|
|
|
|
CMD_SAML_IDPSSOURL=https://*******.onelogin.com/trust/saml2/http-post/sso/******
|
|
|
|
CMD_SAML_IDPCERT=/path/to/idp_cert.pem
|
|
|
|
```
|
|
|
|
10. Try sign-in with SAML from your CodiMD sign-in button or OneLogin dashboard (like the screenshot below).
|
|
|
|

|