Configuring SAML Single Sign-on
Create a realm in Keycloak
- Sign in to Administrator Console, drop the list in the top left corner, and click
Create realm
.
Keycloak initially includes a single realm master
which is used for managing Keycloak only and not for any applications.

- Enter
Realm name
e.g. myrealm and clickCreate
.

- Select
Users
in the left sidebar and clickAdd user
.

- Enter values for
Username
,Email
,First name
andLast name
; then clickCreate
.

- Under
User details
, selectCredentials
tab and clickSet password
to create a password for the user created in the previous step.

- Enter the password and toggle
Temporary
to Off, then clickSave
.

Create SAML directory in MetaDefender Core
- Sign in to MetaDefender Core management console.
- Under
Dashboard
, clickUser Management
in the left sidebar. - Under
User Management
, selectDirectories
tab and hitAdd directory
in the top right.

- On
Add Directory
page, select SAML inDirectory type
. - Fill
Name
of the new directory, such as KEYCLOAK_SAML. - Under
Service Provider
, fill inHost or IP
where MetaDefender Core is being hosted, using https://localhost:8008 as an example. - Copy the value of
Login URL
.

Create Keycloak application
- On screen
myrealm
, selectClients
in the sidebar and clickCreate client
.

- Choose SAML for
Client type
and enter MDCORE forClient ID
then clickNext
.

- Paste the value of
Login URL
from MetaDefender Core intoMaster SAML Processing URL
and clickSave
.

- Go to
Advance
tab and paste the value ofLogin URL
from MetaDefender Core toAssertion Consumer Service Redirect Binding URL
and clickSave
.

- In
Keys
tab, toggleClient signature required
to Off.

- In
Client scopes
tab, selectMDCORE-dedicated
.

- Under
Dedicated scopes
, navigate toMappers
tab and clickAdd predefines mapper
.

- Check
X500 givenName
andX500 surname
, then clickAdd
.

- Back to
Mappers
tabs, click onX500 givenName
.

- Enter first_name to
SAML Attribute Name
and clickSave
.

- Click
X500 surname
inMappers
tab.

- Enter last_name for
SAML Attribute Name
and clickSave
.

- Select
Realm settings
in the sidebar, navigate toGeneral
tab, clickSAML 2.0 Identity Provider Metadata
and copy the metadata link.

Complete configuration in MetaDefender Core
- Switch to MetaDefender Core screen, under
Identity Provider
, clickFetch URL
. - Paste the metadata link from Keycloak to the box under
Fetch URL
and clickOK
to ensure MetaDefender Core can set Keycloak as its IdP.

- Under
Service Provider
section, enableUse Custom Entity ID
and enter MDCORE inCustom Entity ID
field.
The ID set for Use Custom Entity ID
must match Client ID
created by Keycloak.
- Fill in the user identity under
Use Identified by
with ${first_name}_${last_name}, for example. - Select the appropriate role for the user under
User Role
. - Click
Add
to complete the settings.

- On
User Management
screen, toggle the new directory, KEYCLOAK-SAML in this example. A dialog box will appear to confirm the action. OnceEnable
is clicked, all existing sessions will expire immediately.

Test the integration
- Click
Login
from the home screen of MetaDefender Core; the user is redirected to Keycloak page.

- Sign in with the account registered in Keycloak.

- If everything goes well, MetaDefender Core dashboard will be displayed with user identity set in the top right corner.

- Otherwise, access backup login page at
<mdcore-host>#/public/backuplogin
for trouble shooting.
Was this page helpful?