Sign Sign On (SSO)

SSO allows your users to sign into Commenze through your own custom authentication.

You need to have a Commenze business subscription to have access to SSO. If you are currently on the free trial you have access for your trial period.

Enabling SSO

Go to the main dashboard then to the dashboard for your site that you wish to enable SSO for.

From there navigate to Settings using the side bar and tick the checkbox in the SSO section.

Your site is now SSO enabled.

Connecting your users to Commenze

To connect your users to Commenze (sign them in) you need to make a POST request to the following endpoint:

https://api.commenze.com/api/auth/sso/connect

The POST request should contain the following data:

ParameterValueDescriptionRequired
emailstringThe email is used as the unique identifier for the user.Yes
usernamestringThe username is what will be displayed on the Comment section for that user.Yes
expiresInintegerThe amount of milliseconds that the user will stayed signed in for. Its best to match this up with the value you use for your own user cookies, so the user will automatically be signed out of Commenze when they are signed out of your site.Yes
hostnamestringThe hostname identifier provided by Commenze for your site. To find this again go here.Yes
secretstringThe secret given on the SSO section in the settings for your site.Yes
profilePicturestringThe profile picture for the user to be used on the comment section.No

Node.js example:

await fetch("https://api.commenze.com/api/auth/sso/connect", {

method: "POST", true,

body: JSON.stringify({

email, username, expiresIn, hostname, secret

}),

headers: { "Content-Type": "application/json" },

credentials: "include"

});

Disconnecting a user

To disconnect a user (sign them out) you need to make a POST request to the following endpoint:

https://api.commenze.com/api/auth/sso/disconnect

The POST request should contain the following data:

ParameterValueDescriptionRequired
emailstringThe unique identifier of the user you wish to sign out of CommenzeYes
hostnamestringThe hostname identifier provided by Commenze for your site. To find this again go here.Yes
secretstringThe secret given on the SSO section in the settings for your site.Yes