Search Results :

×

DNN OAuth Single Sign-On (SSO) 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 PingFederate considering PingFederate as OAuth Provider. To know more about the other features we provide for DNN OAuth Single Sign-On (SSO), click here.

Pre-requisites: Download and Installation

  • 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

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.

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.
  • DNN Keycloak OAuth SSO - add realm
  • Create realm: Enter Realm Name and keep the realm name handy as it will required later to configure the Realm under the DNN OAuth plugin. Click on CREATE to add realm.
  • DNN Keycloak OAuth SSO - add realm
  • 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.
  • DNN Keycloak OAuth SSO - client id
  • Change Access type: After client is created change its access type to confidential.
  • DNN Keycloak OAuth SSO - change access type
  • Enter Valid Redirect URIs: Copy Callback URL from plugin and then click on SAVE. Ex -- https:///oauth/callback
  • DNN Keycloak OAuth SSO - change access type
  • Get Client Secret: Now we need to get client secret. So select Clients and select credentials and copy your secret from here.
  • DNN Keycloak OAuth SSO - client id client secret
  • Plugin Configuration: Enter copied Client Secret under Client secret field in the DNN OAuth plugin, and enter the Client Name under the Client ID field.
  • 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.
  • DNN Keycloak OAuth 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.

    DNN Keycloak OAuth 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.
  • DNN Keycloak OAuth SSO - map user
  • 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.
  • DNN Keycloak OAuth SSO - add role

    Step 2.1: Steps to fetch Keycloak Groups

    • Create groups: Click on the Groups and choose New to create a new group.
    • DNN Keycloak OAuth 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.
    • DNN Keycloak OAuth SSO - assign group
    • 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 section, select your client and then click on mapper->create.
    • DNN Keycloak OAuth SSO - group mapper DNN Keycloak OAuth SSO - group mapper
    • Now, select mapper type as Group Membership and enter the name and token claim name i.e the attribute name corresponding to which groups will be fetched. Turn Off the full group path, Add to ID token and Add to access token options, and click on Save.
    • DNN Keycloak OAuth SSO - group mapper

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

    Step 2.2: Steps to fetch Keycloak Roles

    • Keycloak Role Mapper: Now to get role details we need to perform its client mapping with role membership else role details will not be fetched. So in Client section, select your client and then click on mapper->create.
    • DNN Keycloak OAuth SSO - group mapper DNN Keycloak OAuth SSO - group mapper
    • Now, select mapper type as user realm Role Membership and enter the name. and token claim name i.e the attribute name corresponding to which groups will be fetched. Add to ID token and Add to access token options, and click on Save.
    • DNN Keycloak OAuth SSO - group mapper
  • Add Realm : Now login to keycloak administration console and navigate to your desired realm. You can add new realm by selecting Create Realm option.
  • DNN Keycloak OAuth SSO - Add realm
  • Create realm: Enter Realm Name and keep the realm name handy as it will required later to configure the Realm under the DNN OAuth plugin. Click on CREATE to add realm.
  • DNN Keycloak OAuth SSO - Create realm
  • Create OpenID client: Click on the Clients and choose Create Client to create a new client. Enter Client ID and select client protocol openid-connect and Click Next.
  • DNN Keycloak OAuth SSO - Create client DNN Keycloak OAuth SSO - Add client id
  • Enable the Client Authentication and Authorization toggle.
  • DNN Keycloak OAuth SSO - Enable toggle
  • Scroll down to the Access settings and enter your Callback/Redirect URL which you will get from your miniOrange plugin present on your Client side under the CallBack URLs text-field.
  • DNN Keycloak OAuth SSO - callback url
  • Go to the Credentials tab, copy the Client Secret and keep it handy as we will require it later while configuring DNN OAuth Single Sign-On plugin.
  • DNN Keycloak OAuth SSO - Copy client secret
  • Plugin Configuration: Enter copied Client Secret under Client secret field in the DNN OAuth plugin, and enter the Client ID under the Client ID field.
  • Add User: We need to add users to realm who will be able to access the resources of realm. Click on the Users and Click on Create new user to Add a new User.
  • DNN Keycloak OAuth 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.

    DNN Keycloak OAuth 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.
  • DNN Keycloak OAuth SSO - map user
  • 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 Create Role.
  • DNN Keycloak OAuth SSO - add role

3. Testing OAuth SSO

  • 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

4. Attribute Mapping

  • 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.

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 even configure the ASP.NET SAML 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. To check other identity providers, click here.

Additional Resources

Need Help?

Not able to find your identity provider? Mail us on dnnsupport@xecurify.com and we'll help you set up SSO with your IDP and for quick guidance (via email/meeting) on your requirement and our team will help you to select the best suitable solution/plan as per your requirement.

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