|
| 1 | +Authentication guide - SAML (OneLogin) |
| 2 | +=== |
| 3 | + |
| 4 | +1. Sign-in or sign-up for an OneLogin account. (available free trial for 2 weeks) |
| 5 | +2. Go to the administration page. |
| 6 | +3. Select the **APPS** menu and click on the **Add Apps**. |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +4. Find "SAML Test Connector (SP)" for template of settings and select it. |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +5. Edit display name and icons for OneLogin dashboard as you want, and click **SAVE**. |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +6. After that other tabs will appear, click the **Configuration**, and fill out the below items, and click **SAVE**. |
| 19 | + * RelayState: The base URL of your hackmd, which is issuer. (last slash is not needed) |
| 20 | + * ACS (Consumer) URL Validator: The callback URL of your hackmd. (serverurl + /auth/saml/callback) |
| 21 | + * ACS (Consumer) URL: same as above. |
| 22 | + * Login URL: login URL(SAML requester) of your hackmd. (serverurl + /auth/saml) |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +7. The registration is completed. Next, click **SSO** and copy or download the items below. |
| 27 | + * X.509 Certificate: Click **View Details** and **DOWNLOAD** or copy the content of certificate ....(A) |
| 28 | + * SAML 2.0 Endpoint (HTTP): Copy the URL ....(B) |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +8. In your hackmd server, create IdP certificate file from (A) |
| 33 | +9. Add the IdP URL (B) and the Idp certificate file path to your config.json file or pass them as environment variables. |
| 34 | + * config.json: |
| 35 | + ````javascript |
| 36 | + { |
| 37 | + "production": { |
| 38 | + "saml": { |
| 39 | + "idpSsoUrl": "https://*******.onelogin.com/trust/saml2/http-post/sso/******", |
| 40 | + "idpCert": "/path/to/idp_cert.pem" |
| 41 | + } |
| 42 | + } |
| 43 | + } |
| 44 | + ```` |
| 45 | + * environment variables |
| 46 | + ```` |
| 47 | + HMD_SAML_IDPSSOURL=https://*******.onelogin.com/trust/saml2/http-post/sso/****** |
| 48 | + HMD_SAML_IDPCERT=/path/to/idp_cert.pem |
| 49 | + ```` |
| 50 | +10. Try sign-in with SAML from your hackmd sign-in button or OneLogin dashboard (like the screenshot below). |
| 51 | + |
| 52 | + |
0 commit comments