Skip to content

Commit b7b215d

Browse files
OAuth 2.0 integration (#351)
* OAuth 2.0 integration * Fix image size * Updated the doc with new images and content
1 parent d6a2ce8 commit b7b215d

File tree

5 files changed

+85
-0
lines changed

5 files changed

+85
-0
lines changed
62.6 KB
Loading
47.5 KB
Loading
48.6 KB
Loading
50.6 KB
Loading

source/adminguide/accounts.rst

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,91 @@ The following global configuration should be configured:
627627

628628
- ``saml2.timeout``: SAML2 IDP Metadata refresh interval in seconds, minimum value is set to 300. Default is 1800
629629

630+
Using OAuth2 Authentication For Users
631+
------------------------------------------
632+
633+
OAuth2, the industry-standard authorization or authentication framework, simplifies the process of
634+
granting access to resources. CloudStack supports OAuth2 authentication wherein users can login into
635+
CloudStack without using username and password. CloudStack currently supports Google and Github providers.
636+
Other OAuth2 providers can be easily integrated with CloudStack using its plugin framework.
637+
638+
For admins, the following are the settings available at global level to configure OAuth2.
639+
640+
.. cssclass:: table-striped table-bordered table-hover
641+
642+
================================================ ================ ===================================================================
643+
Global setting Default values Description
644+
================================================ ================ ===================================================================
645+
oauth2.enabled false Indicates whether OAuth plugin is enabled or not
646+
oauth2.plugins google,github List of OAuth plugins
647+
oauth2.plugins.exclude List of OAuth plugins which are excluded
648+
================================================ ================ ===================================================================
649+
650+
The login page when the OAuth2 is enabled and corresponding providers are configured.
651+
652+
.. image:: /_static/images/oauth-login.png
653+
:width: 400px
654+
:align: center
655+
:alt: Login page with OAuth logins
656+
657+
"OAuth configuration" sub-section is added under "Configuration" where admins can register the corresponding
658+
OAuth providers.
659+
660+
.. image:: /_static/images/oauth-sub-section.png
661+
:width: 120px
662+
:align: center
663+
:alt: OAuth configuration section
664+
665+
.. image:: /_static/images/oauth-configuration-details.png
666+
:width: 400px
667+
:align: center
668+
:alt: OAuth configuration details
669+
670+
To register the OAuth provider client ID, redirect URI, secret key have to provided.
671+
OAuth 2.0 has to be first configured in the corresponding provider to obtain the client ID, redirect URI, secret Key.
672+
673+
For Google, please follow the instructions mentioned here `"Setting up OAuth 2.0 in Google" <https://support.google.com/cloud/answer/6158849?hl=en>`_.
674+
For Github, please follow the instructions mentioned here `"Setting up OAuth 2.0 in Github" <https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app>`_.
675+
676+
In any OAuth 2.0 configuration admin has to use the redirect URI "http://<management server IP>:<port>/#/verifyOauth"
677+
678+
.. Note:: [Google OAuth 2.0 redirect URI] :
679+
Google OAuth 2.0 configuration wont accept '#' in the URI, please use "http://<management server Domain>:<port>/?verifyOauth"
680+
Google does not accept direct IP address in the redirect URI, it must be a domain. As a workaround one can add the management
681+
server IP to host table in the local system and assign a domain, something like "management.cloud". In that redirect URI looks like
682+
"http://management.cloud:8080/?verifyOauth"
683+
684+
.. image:: /_static/images/oauth-provider-registration.png
685+
:width: 400px
686+
:align: center
687+
:alt: OAuth provider registration
688+
689+
Following are the details needs to be provided to register the OAuth provider, this is to call the API "registerOauthProvider"
690+
691+
- **Provider**: Name of the provider from the list of OAuth providers supported in CloudStack
692+
693+
- **Description**: A short description for the provider
694+
695+
- **Provider Client ID**: Client ID pre-registered in the specific OAuth provider
696+
697+
- **Redirect URI**: Redirect URI pre-registered in the specific OAuth provider
698+
699+
- **Secret Key**: Secret Key pre-registered in the specific OAuth provider
700+
701+
Cloudmonkey API call looks like
702+
703+
- register oauthprovider provider=google description="Google Provider"
704+
clientid="http://345798102268-3kp6qd6c16v6b9av2tmvqagj40na30l4.apps.googleusercontent.com"
705+
redirecturi="http://local.cloud:8080/?verifyOauth" secretkey="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"
706+
707+
Email address is the key to identify the user in CloudStack. In case if user belongs to any specific domain, domain name
708+
has to be provided in the login form and then click on OAuth login.
709+
710+
.. image:: /_static/images/user-domain-login.png
711+
:width: 400px
712+
:align: center
713+
:alt: Login page for user under specific domain
714+
630715
Using Two Factor Authentication For Users
631716
------------------------------------------
632717

0 commit comments

Comments
 (0)