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 - 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.
  • DNN Keycloak OAuth SSO - 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.
  • DNN Keycloak OAuth SSO - 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.

    DNN Keycloak OAuth SSO - 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.
  • DNN Keycloak OAuth SSO - Keycloak Single Sign-On SSO map user
  • Create groups: Click on the Groups and choose New to create a new group.
  • DNN Keycloak OAuth SSO - 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.
  • DNN Keycloak OAuth SSO - 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.
  • DNN Keycloak OAuth SSO - Keycloak Single Sign-On SSO client id
  • Change Access type: After client is created change its access type to confidential.
  • DNN Keycloak OAuth SSO - Keycloak Single Sign-On SSO change access type
  • Enter Valid Redirect URIs: Copy callback URL from plugin and then click on SAVE. Ex -- https://<domain-name>/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.
  • DNN Keycloak OAuth SSO - 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.
  • DNN Keycloak OAuth SSO - 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

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