SAML with EntraID (Azure AD)
Create Application
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
Assign Groups
Go
- Click "Assign users and groups"
- Click "None Selected" under groups.
- Add the user groups you wish to
Stepaccess1Knocknoc 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
- Click
anSetEntraupGroupsingleforsigneachon. - Click SAML.
- In the Basic SAML section,
setadd the links to your Knocknoc instance.- Set the Indentifier (Entity ID) to
your knocknoc instance URL:https://demo.knoc.cloud/cloud/api/saml/metadata - Set the Reply URL (Assertion Consumer Service URL)
(ACS)Set thisto https://demo.knoc.cloud/api/saml/acs - Leave the Optional Basic SAML Configuration options blank at this stage and click Save.
- Set the Indentifier (Entity ID) to
- In the Attributes & Claims
andsectionAttributes- Update the Required Claim, changing the Name Identifier Format to Persistent
- Remove
all other Claims.
- Add a group
Claim,Claim.select- Select Security Groups
- Select Group ID for the Source Attribute.
Select - Check "Customize the name of the group claim"
- Add the Name as, groups.
- Click save when done.
andSaveRemove - Add in a New Claim
- Add another New Claim
- Set the
following:Name as"SessionDuration"
- Leave Source as Attribute.
- Set
SessionDurationSource Attribute towhatever you wantthe defaultSessionsDurationlogin duration in seconds for users logging in tobe.Knocknoc. You can manually override this with a user attributelater.later
- Set the
- Add a third New Claim
- Update the Required Claim, changing the Name Identifier Format to Persistent
- SAML Certificates
Upload- Generate a new
certcertificate andkey: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 - Convert the
certcertificate topfx: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
- Enter a password and note it down.
- Import
itCertificate,toselect thetoken signingpfx certificatesectionyou just created and enter the password. - Then make
ittheactivenew certificateActive by clicking the dots on the right and choosing Make Certificate Active.
- Download the federation Metadata XML.
your own certificate created like so:On your own PC or similar:MakeconvertThen download - Generate a new
- Set Up Knocknoc
- Copy the Login URL, this will be required for the Knocknoc SAML config.
Then go to Step 2, Single Sign-on and select
Here is where the fun begins!
Basic Saml Configuration
Knocknoc SAML Config
- Login In the Knocknoc admin
sectioninterface. - Click
toonSettings,Settingsegonhttps://demo.knoc.cloud/admin/settingsthe left. - Under
inPublicyourURLPublicURLenteregyouhttps://demo.knoc.cloudknocknoc-url.DON'TNote: do not add a / at theend!endof the URL.
- For the SAMLMetaDataFile, upload the xml file you downloaded from
theEntraID. - For the SAMLCertFile, upload the
Certificatecertificate (.crt) file youdownloadedcreated in during thepreviousSAMLstep.
Configuration. - For the SAMLKeyFile, upload the
Keykey (.key) file youdownloadedcreated in during thepreviousSAMLstep.
Configuration. - For the SAMLMetadataUrl, paste the Login URL
from section 4copied intheStepEntra6Samp Sign section and paste it into SAMLMetadataUrlMake 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.keyThen convertof thecertprevioustosection. - Click
AddThenSave.
Type
Copy
openssl pkcs12 -export -out user-demo-knoc-cloud.pfx -inkey user-demo-knoc-cloud.key -in user-demo-knoc-cloud.crt
Upload SAML Certificate
Back into Entra ID -> SAML Certificates - Edit. Import Certificate, select the pfx certificate you just created, and enter the password.