Configuring Single Sign-On for WSO2 SP
SSO (Single Sign-On) allows you to be authenticated to access one application, and gain access to multiple other applications without having to repeatedly provide your credentials for authentication purposes. This section explains how you can configure single sign-on for the WSO2 Dashboard Portal, Status Dashboard and the Business Rules Manager.
Before you begin:
Configure the external identity provider (IdP) that you are using for SSO. By default, WSO2 SP uses WSO2 IS (versions 5.4.0 and later) as the Identity Provider. For detailed instructions to configure WSO2 IS for this scenario, see OAuth2 Token Validation and Introspection.
If you want to use any other identity provider, make sure that it supports OAuth 2 Dynamic Client Registration, and do the required configurations (which differ based on the IdP).
Enabling SSO
To configure SSO for the WSO2 SP, open the <SP_HOME>/conf/dashboard/deployment.yaml file and update it as follows:
In the
auth.configssection, start creating a new entry with a new client type. You need an external IdP client for SSO. Therefore, enterexternalas the type.auth.configs:
type: externalTo enable SSO, set the
ssoEnabledproperty as shown below.auth.configs:type: externalssoEnabled: trueCreate the
WSO2_OAUTH_APP_DBdatabase and add the datasource.
Add the following configuration in the<SP_HOME>/conf/dashboard/deployment.yamlfile.wso2.datasources: dataSources: - name: WSO2_OAUTH_APP_DB description: The datasource used to store the details, client name, client ID and client secret. name: jdbc/WSO2_OAUTH_APP_DB definition: type: RDBMS configuration: jdbcUrl: jdbc:mysql://<hostname>:<port>/<database_name> username: <username> password: <password> driverClassName: com.mysql.jdbc.Driver minIdle: 5 maxPoolSize: 50 idleTimeout: 60000 connectionTestQuery: SELECT 1 validationTimeout: 30000 isAutoCommit: falseIn order to allow SSO to function in your SP setup, you need to set the following properties under the
ssoEnabledproperty.auth.configs:type: externalssoEnabled: true
properties:
kmDcrUrl:https://localhost:9443/identity/connect/register
kmTokenUrl:https://localhost:9443/oauth2
kmUsername: admin
kmPassword: admin
idpBaseUrl:https://localhost:9443/scim2
idpUsername: admin
idpPassword: admin
portalAppContext: portal
statusDashboardAppContext: monitoring
businessRulesAppContext : business-rules
databaseName: WSO2_OAUTH_APP_DB
cacheTimeout: 900
baseUrl:https://localhost:9643
grantType: authorization_codeThe purposes of these properties are explained in the table below.
Property
Default Value
Description
kmDcrUrlhttps://localhost:9443/identity/connect/registerThe Dynamic Client Registration (DCR) endpoint of the key manager in the IdP.
kmTokenUrlhttps://localhost:9443/oauth2The token endpoint of the key manager in the IdP.
kmUsernameadminThe username for the key manager in the IdP.
kmPasswordadminThe password for the key manager in the IdP.
idpBaseUrlhttps://localhost:9443/scim2The SCIM2 endpoint of the IdP.
idpUsernameadminThe username for the IdP.
idpPasswordadminThe password for the IdP.
portalAppContextportalThe application context of the Dashboard Portal application in WSO2 SP.
statusDashboardAppContextmonitoringThe application context of the Status Dashboard application in WSO2 SP.
businessRulesAppContextbusiness-rulesThe application context of the Business Rules application in WSO2 SP.
databaseNameWSO2_OAUTH_APP_DBThe application context of the Business Rules application in WSO2 SP.
cacheTimeout900The cache timeout for the validity period of the token in seconds.
baseUrlhttps://localhost:9643The base URL to which the token should be redirected after the code returned
from the Authorization Code grant type is used to get the token.
grantTypeauthorization_codeThe grant type used in the OAuth application token request.
externalLogoutUrlhttps://localhost:9443/samlssoThe URL via which you can llog out from the external IDP provider side in the SSO.
Save your changes.
Testing the SSO configuration
Once the above changes are made, you can start the dashboard server of WSO2 SP and access all the UIs in it with a single sign-on. To try this out, follow the steps below:
Start the dashbaord server by issuing one of the following commands:
On Windows:
dashboard.bat --runOn Linux/Mac OS:
sh dashboard.sh
Access the Dashboard Portal via the following URL.
In the dialog box that appears to sign in, enter
adminas both the user name and the password, and then click LOG IN.Now access the Business Rules Manager via the following URL.
https://localhost:9643/business-rules
No dialog box appears for the Business Rules Manager. This because you provided your credentials to access the Dashboard Portal, and the activation of SSO makes that sign-in valid for all the UIs accessible via the dashboard profile.