OAuth Single Sign-On (SSO) For DotNetNuke Sites Using Keycloak As OAuth Provider

DNN OAuth Single Sign-On (SSO) module gives the ability to enable OAuth Single Sign-On for your DotNetNuke site. Using Single Sign-On you can use only one password to access your DotNetNuke site and services. Our module is compatible with all the OAuth compliant Identity providers. Here we will go through a step-by-step guide to configure Single Sign-On (SSO) between DNN and Keycloak as OAuth Provider.

Download and install module in DotNetNuke

  • Download the DNN Oauth Single Sign On module with above link.
  • Extract the package and upload the extension dnn-oauth-single-sign-on_xxx_Install by going to Settings > Extension > Install Extension
  • DNN Keycloak OAuth SSO - oauthclientsso

Step 1: Adding Module on DNN page

  • Open any of the page on your DNN site (Edit mode) and Click on Add Module .
  • DNN Keycloak OAuth SSO - add dnn module
  • Search for oauthclientsso and click on the oauthclientsso. Drag and drop the module on the page where you want.
  • DNN Keycloak OAuth SSO - oauthclientsso
  • You have finished with the Installation of the module on your DNN site.
  • If you want to add module on every page of your dnn site, go to Module Settings >> Module Settings >> Advanced Settings.
  • DNN Keycloak OAuth SSO - oauthclientsso
  • Check the box for Display Module on All Pages and click on Update.

Step 2: Configure Keycloak as OAuth Provider

  • First of all, Download Keycloak and install it.
  • Start Server: Start the keycloak server by running the _standalone.sh_ file.
  • Root Directory of keycloak bin standalone.sh
  • Add Realm : Now login to keycloak administration console and navigate to your desired realm. You can add new realm by selecting Add Realm option.
  • Keycloak Single Sign-On SSO add realm
  • Create realm: Enter Realm Name and click on CREATE to add realm.
  • Create ROLE: The Role will be used by your applications to define which users will be authorized to access the application. Click on the Roles and choose Add Role.
  • Keycloak Single Sign-On SSO add role
  • Add User: We need to add users to realm who will be able to access the resources of realm. Click on the Users and choose to Add a new User.
  • Keycloak Single Sign-On SSO add user
  • User Configuration: After user is created following action needs to be performed on it.
    • 1) Setting a password for it so click on Credentials and set a new Password for the user.

    Keycloak Single Sign-On SSO set password

    NOTE : Disabling Temporary will make user password permanent.

  • Map User: We need to map user to a role. Click on Role Mappings and assign the user desired role from available roles and clicking on add selected.
  •  Keycloak Single Sign-On SSO map user
  • Create groups: Click on the Groups and choose New to create a new group.
  •  Keycloak Single Sign-On SSO create group
  • Assign user to group: Select the user whom you want to add in group. Choose Groups option from tab and then select the group-name and click on join.
  •  Keycloak Single Sign-On SSO assign group
  • Create OpenID client: Click on the Clients and choose create to create a new client. Enter client id and select client protocol openeid-connect and select Save.
  •  Keycloak Single Sign-On SSO client id
  • Change Access type: After client is created change its access type to confidential.
  •  Keycloak Single Sign-On SSO change access type
  • Enter Valid Redirect URIs: Copy callback URL from plugin and then click on SAVE. Ex -- https:///oauth/callback
  • Keycloak Group Mapper: Now to get group details we need to perform its client mapping with group membership else group details will not be fetched. So in client select Mappers and then click on create. Select mapper type Group Membership and enter name and token claim-name i.e the attribute name corresponding which groups will be fetched. Turn Off full group path and click on Save.
  • Keycloak Single Sign-On SSO group mapper

    Note: -- If full path is on group path will be fetched else group name will be fetched.

  • Realm name: You need a realm name when you set up Keycloak as an OAuth provider. Go to the Realm Settings tab and copy the realm name.
  • Get Client Secret: Now we need to get client secret. So select Clients and select credentials and copy your secret from here.
  •  Keycloak Single Sign-On SSO client id client secret
  • Plugin Configuration: Enter copied Client Secret here Client ID will be your client name and the URL are given below.

  • Keycloak Endpoints and Scope:


    Client ID : Click Here
    Client Secret : Click Here
    Scope: email profile openid
    Authorize Endpoint: <keycloak domain>/auth/realms/{realm-name}/protocol/openid-connect/auth
    Access Token Endpoint: <keycloak domain>/auth/realms/{realm-name}/protocol/openid-connect/token
    Get User Info Endpoint: <keycloak domain>/auth/realms/{realm-name}/protocol/openid-connect/userinfo
    Custom redirect URL after logout: [optional] https://{domain-name}/auth/realms/{realm-name}/protocol/openid-connect/logout?redirect_uri=encodedRedirectUri

Step 3: Test Configuration

  • After saving settings, you can see the list of applications you have configured.
  • Click on Edit to update the configuration.
  • DNN Keycloak OAuth SSO - test config
  • Click on Test Configuration to check if the configuration is correct.
  • On successful configuration, you will get Attributes Name and Attribute Values on Test Configuration window.
  • DNN Keycloak OAuth SSO - succesful config

Step 4: Mapping the basic attributes

  • Go to the oauthclientsso settings >> Advanced Settings >> Attribute Mapping.
  • DNN Keycloak OAuth SSO - attribute mappiing
  • Map email and username with Attribute Name you can see in Test Configuration window.

Step 5: Adding widget

  • For adding the widget go to Add Widget.
  • DNN Keycloak OAuth SSO - adding widget
  • Click on Add Widget button. A button will be added on the DNN page.

    You can configure the DNN OAuth Single Sign-On (SSO) module with any Identity Provider such as ADFS, Azure AD, Bitium, Centrify, G Suite, JBoss Keycloak, Okta, OneLogin, Salesforce, AWS Cognito, OpenAM, Oracle, PingFederate, PingOne, RSA SecureID, Shibboleth-2, Shibboleth-3, SimpleSAML, WSO2 or even with your own custom identity provider.

Application LINK
SAML SSO into DotNetNuke (DNN) site Click here
SAML SSO into SiteFinity site Click here
SAML SSO into Umbraco site Click here
Hello there!

Need Help? We are right here!

support
Contact miniOrange Support
success

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com