oauth.rst.txt 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ====================
  2. Integrating OAuth
  3. ====================
  4. Introduction
  5. ==============
  6. As of v0.8.5, Netmaker offers integration with the following OAuth providers:
  7. - GitHub
  8. - Google
  9. - Microsoft Azure AD
  10. By integrating with an OAuth provider, your Netmaker users can log in via the provider, rather than the default simple auth.
  11. Configuring your provider
  12. ===========================
  13. In order to use OAuth, configure your OAuth provider (GitHub, Google, Azure AD).
  14. You must configure your provider to use the Netmaker Dashboard URI dashboard.<netmaker.base.domain> as the origin URL.
  15. For example: `https://dashboard.netmaker.mydomain.com`
  16. You must configure your provider to use the Netmaker API URI redirect route with the following format: https://api.<netmaker base domain>/api/oauth2/callback.
  17. For example: `https://api.netmaker.mydomain.com/api/oauth2/callback`
  18. General provider instructions can be found with the following links:
  19. Instructions for GitHub: https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/oauth_provider/#github-auth-provider
  20. Instructions for Google: https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/oauth_provider/#google-auth-provider
  21. Instructions for Microsoft Azure AD: https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/oauth_provider/#microsoft-azure-ad-provider
  22. Configuring Netmaker
  23. ======================
  24. After you have configured your OAuth provider, take note of the CLIENT_ID and CLIENT_SECRET.
  25. Next, Configure Netmaker with the following environment variables. If any are left blank, OAuth will fail.
  26. .. code-block::
  27. AUTH_PROVIDER="<azure-ad|github|google>"
  28. CLIENT_ID="<client id of your oauth provider>"
  29. CLIENT_SECRET="<client secret of your oauth provider>"
  30. SERVER_HTTP_HOST="https://<your-netmaker-api-domain>"
  31. FRONTEND_URL="https://<your-netmaker-dashboard-domain>"
  32. After restarting your server, the Netmaker logs will indicate if the OAuth provider was successfully initialized.
  33. Once successful, users can click the key symbol on the login page to sign-in with your configured OAuth provider.
  34. .. image:: images/oauth1.png
  35. :width: 80%
  36. :alt: Login Oauth
  37. :align: center
  38. Configuring User Permissions
  39. ===============================
  40. All users logging in will have zero permissions on first sign-in. An admin must configure all user permissions.
  41. Admins must navigate to the "Users" screen to configure permissions.
  42. For each user, an admin must specify which networks that user has access to configure. Additionally, an Admin can elevate a user to Admin permissions.
  43. .. image:: images/oauth3.png
  44. :width: 80%
  45. :alt: Edit User 2
  46. :align: center
  47. .. image:: images/oauth2.png
  48. :width: 80%
  49. :alt: Edit User
  50. :align: center