Skip to main content

SAML with EntraID (Azure AD)

Create Application

Navigate to the Microsoft Entra admin center, then go to Identity -> Applications -> Enterprise Applications
Click New Application, and then Create your own application, type a name for your application, like 'knocknoc-dev'. and choose "Integrate any other application you don't find in the gallery (Non-gallery) and click Create.

The following assumes your knocknoc instance is located at https://demo.knoc.cloud. Wherever you see that, please substitute it for your own instance URL.

Setting Up the IdP

Create Application

  1. Navigate to the Microsoft Entra admin center and login with administrator credentials.
  2. Go to Identity and select Applications than Enterprise Applications
    Enterprise Application Menu.png
  3. Click New Application
  4. Click Create your own application.
  5. Type a name for your application (e.g  knocknoc)
  6. Check "Integrate any other application you don't find in the gallery (Non-gallery)"
  7. Click Create.

Create Application.png

Assign Groups

Go

  1. Click "Assign users and groups"
  2. Click "None Selected" under groups.
  3. Add the user groups you wish to Stepaccess 1Knocknoc protected services.

Note: Knocknoc and AssignEntraID agroup Usernames orneed group.to Ideallymatch youfor shouldautomatic useuser aassignment. group,Best aspractice is to have at least one group per Knocknoc mapsprotected Groups to Acls, and the names have to match.
service.

So

SAML youConfiguration

will
    need
  1. Click anSet Entraup Groupsingle forsign eachon.
  2. Knocknoc Group, and that needs to contain the ACLs you want that group to have.

    Then go to Step 2, Single Sign-on and select

  3. Click SAML.

  4. Here is where the fun begins!

    Basic Saml Configuration


  5. In the Basic SAML section, setadd the links to your Knocknoc instance.
    1. Set the Indentifier (Entity ID) to your knocknoc instance URL: https://demo.knoc.cloud/cloud/api/saml/metadata

    2. Set the Reply URL (Assertion Consumer Service URL) (ACS)
      Set this to https://demo.knoc.cloud/api/saml/acs

    3. Leave the Optional Basic SAML Configuration options blank at this stage and click Save.

  6. In the Attributes & Claims andsection Attributes

    1. Update the Required Claim, changing the Name Identifier Format to Persistent


      image.png
    2. image.png

    3. Remove

      all other Claims.

    4. Add a group Claim,Claim. select
      1. Select Security Groups
      2. and
      3. Select Group ID for the Source Attribute. Select
      4. Save
      5. Check "Customize the name of the group claim"
      6. Add the Name as, groups.
      7. Click save when done.


        Group Claim.png
      8. image.png

      Remove

    5. Add in a New Claim
      1. Set the otherName Claims,as and"realName".
      2. add
      3. Leave backSource inas Attribute.
      4. Set Source Attribute to "user.displayname".

         

        3Crimage.png
    6. Add another New Claim
      1. Set the following:

        Name

        image.png

        as

        "SessionDuration"

      2. Leave Source as Attribute.
      3. Set SessionDurationSource Attribute to whatever you want the default SessionsDurationlogin duration in seconds for users logging in to be.Knocknoc. You can manually override this with a user attribute later.

        later

        for specific users.image.pngimage.png


    7. Add a third New Claim
      1. Set the Name as "username"
      2. Leave Source as Attribute.
      3. Set Source Attribute "user.userprincipalname"
        image.pngimage.png



  7. SAML Certificates

    Upload

      your own certificate created like so:

      On your own PC or similar:
      Make

    1. Generate a new certcertificate and key:key, this can be done on a Linux host using the below command.
      openssl req -new -x509 -days 3650 -nodes -subj /CN=Knocknoc/ -out user-demo-knoc-cloud.crt -keyout user-demo-knoc-cloud.key

      Then
    2. convert
    3. Convert the certcertificate to pfx:pfx using the following command.
      openssl pkcs12 -export -out user-demo-knoc-cloud.pfx -inkey user-demo-knoc-cloud.key -in user-demo-knoc-cloud.crt
    4. Enter a password and note it down.

    5. Import itCertificate, toselect the token signingpfx certificate sectionyou just created and enter the password.
    6. Then make itthe active

      new

      certificate

      Active by clicking the dots on the right and choosing Make Certificate Active.
      image.pngimage.png


    7. Then download

    8. Download the federation Metadata XML.

  8. Set Up Knocknoc
    1. Copy the Login URL, this will be required for the Knocknoc SAML config.

Knocknoc SAML Config


  1. Login In the Knocknoc admin sectioninterface.
  2. go
  3. Click toon Settings,Settings egon https://demo.knoc.cloud/admin/settingsthe left.

  4. Type

  5. Under inPublic yourURL PublicURLenter egyou https://demo.knoc.cloudknocknoc -url. DON'TNote: do not add a / at the end!

    end

    of the URL.

  6. For the SAMLMetaDataFile, upload the xml file you downloaded from theEntraID.
  7. previous step.
  8. For the SAMLCertFile, upload the Certificatecertificate (.crt) file you downloadedcreated in during the previousSAML step.
    Configuration.
  9. For the SAMLKeyFile, upload the Keykey (.key) file you downloadedcreated in during the previousSAML step.

    Configuration.
  10. Copy

  11. For the SAMLMetadataUrl, paste the Login URL from section 4copied in theStep Entra6 Samp Sign section and paste it into SAMLMetadataUrl

    Make a new cert and key:
    openssl req -new -x509 -days 3650 -nodes -subj /CN=Knocknoc/ -out user-demo-knoc-cloud.crt -keyout user-demo-knoc-cloud.key

    Then convertof the certprevious tosection.

  12. pfx:
    openssl pkcs12 -export -out user-demo-knoc-cloud.pfx -inkey user-demo-knoc-cloud.key -in user-demo-knoc-cloud.crt
    Enter a password and note it down.

    Upload SAML Certificate

    Back into Entra ID -> SAML Certificates - Edit. Import Certificate, select the pfx certificate you just created, and enter the password.

  13. Click Add
    ThenSave.
  14. make the new certificate Active, but clicking the dots menu on the right and choosing Make Certificate Active.