SAML Configuration (Pro)
DefectDojo Pro supports SAML authentication, configured from Connect > Authorization > Providers. Open-source DefectDojo does not include SSO โ see Authorized Users for open-source access control.
ACS URL (Assertion Consumer Service)
Your Identity Provider needs to know where to POST the SAML response after a user authenticates. DefectDojo’s ACS URL is:
https://<your-instance>.cloud.defectdojo.com/saml2/acs/On a self-hosted instance it is the same path on your own hostname: https://<your-hostname>/saml2/acs/.
A few things to know about this endpoint:
- The endpoint accepts
POSTrequests only. Opening the ACS URL directly in a browser issues a GET and will return an HTTP 405 Method Not Allowed. This is expected behavior โ it does not mean SAML is broken or misconfigured. The endpoint is designed to be invoked by your IdP as part of the SAML redirect flow, not by a browser typing the URL. - The ACS URL is available on your DefectDojo Cloud instance at all times โ you do not need to enable SAML in DefectDojo first before pointing your IdP at it. You can configure the IdP side and the DefectDojo side in either order.
Setup
Open Connect > Authorization > Providers and select SAML.

Set an Entity ID โ a label or URL that your SAML Identity Provider uses to identify DefectDojo. This field is required.
Optionally set Login Button Text โ the text shown on the button users click to begin SAML login.
Optionally set a Logout URL to redirect users to after they log out of DefectDojo.
Choose a Name ID Format:
- Persistent โ users are consistently identified by SAML across sessions.
- Transient โ users receive a different SAML ID on each login.
- Entity โ all users share a single SAML NameID.
- Encrypted โ each user’s NameID is encrypted.
Required Attributes โ specify the attributes DefectDojo requires from the SAML response.
Attribute Mapping โ map the attributes your IdP sends to the DefectDojo user fields they should populate. Each row pairs one SAML Attribute with one DefectDojo Field; use Add Attribute Mapping for additional rows and the bin icon to remove one.

- SAML Attribute is free text and must match the attribute name your IdP actually emits, exactly and including case: a row for
UserNamedoes nothing when the IdP sendsUsername. Some IdPs (e.g. Entra ID / Azure AD) send fully qualified claim URIs such ashttp://schemas.microsoft.com/identity/claims/emailaddressrather than friendly names. If you are not sure what your IdP sends, sign in once and open the attempt in SAML Login Attempts (see See which attributes the IdP sent). - DefectDojo Field is chosen from a list: Username, First Name, Last Name and Email.
- A mapping fills user fields. By default it does not decide which account a login lands on: DefectDojo signs the login in to the account whose username equals the SAML
NameID, and a Username mapping is not used for that unless Use Mapped Username is on (see Which account a login lands on). - Mapping an attribute to Email is strongly recommended: DefectDojo uses the email address for notifications.
- The same attribute may feed more than one field. The reverse is not allowed: each DefectDojo field may be mapped from only one attribute.
- A row with only one half filled in is rejected on save, and the offending cell is highlighted. Rows you add but never fill in are discarded rather than treated as errors.
- SAML Attribute is free text and must match the attribute name your IdP actually emits, exactly and including case: a row for
IdP metadata โ supply one of the two, not both:
- Remote SAML Metadata (the default) โ the URL where your SAML Identity Provider metadata is hosted. DefectDojo fetches it, so the instance must be able to reach that URL. Prefer this when it can, because the IdP keeps the metadata current.
- Local SAML Metadata โ check Use Local SAML Metadata and upload the metadata XML file downloaded from your IdP (up to 1 MB). Use this when the instance cannot reach the IdP’s metadata URL, for example a self-hosted instance with no outbound internet access. DefectDojo stores the file as
saml_metadata.xmlin its media directory and shows it on the form the next time you open it. Upload a new file whenever the IdP’s signing certificate changes.
Check Enable SAML at the bottom of the form to activate SAML login. A Login With SAML button will appear on the DefectDojo login page.
.
Additional Options
- Create Unknown User โ automatically create a new DefectDojo user if they are not found in the SAML response.
- Use Mapped Username โ take the username from the attribute mapped to Username instead of from the
NameID, falling back to theNameIDwhen the assertion does not carry that attribute. Off by default. See Which account a login lands on before turning it on. - Allow Unknown Attributes โ allow login for users who have attributes not listed in the Attribute Mapping.
- Sign Assertions/Responses โ require all incoming SAML responses to be signed.
- Sign Logout Requests โ sign all logout requests sent by DefectDojo.
- Force Authentication โ require users to authenticate with the Identity Provider on every login, regardless of existing sessions.
- Enable SAML Debugging โ log detailed SAML output for troubleshooting. See Troubleshooting โ SAML Debugging output for where the log output appears.
SAML Group Mapping
DefectDojo can use the SAML assertion to automatically assign users to User Groups. Groups in DefectDojo assign permissions to all of their members, so Group Mapping allows you to manage permissions in bulk. This is the only way to set permissions via SAML.
Group mapping is optional. Although the Group Name Attribute and Group Limiter Regex Expression fields appear with a required-field asterisk (*) in the UI, the SAML form will submit without them, and SAML login will work without group mapping. You do not need to pre-build groups or roles in your IdP (e.g. Azure AD application roles) before enabling SAML โ you only need to configure these fields when you actually want DefectDojo to read group membership from the assertion. If you do not configure group mapping, newly created SSO users will have no permissions by default; see Default access for SSO-provisioned users below.
The Group Name Attribute field specifies which attribute in the SAML assertion contains the user’s group memberships. When a user logs in, DefectDojo reads this attribute and assigns the user to any matching groups. To limit which groups from the assertion are considered, use the Group Limiter Regex Expression field โ this is a regular expression applied to the group names from the assertion, used to filter which ones DefectDojo should act on.
The value must match the attribute name your Identity Provider emits in the assertion exactly, including any namespace prefix. A short, friendly name like groups will only work if your IdP is configured to emit that literal attribute name โ many IdPs use a fully qualified claim URI instead.
Group Name Attribute by Identity Provider
| Identity Provider | Default attribute name to use |
|---|---|
| Entra ID / Azure AD | http://schemas.microsoft.com/ws/2008/06/identity/claims/groups |
| Okta | groups (the attribute name you configured on the SAML app’s Group Attribute Statement) |
| Keycloak | groups (or whatever you set as the “SAML Attribute Name” on the Group List mapper) |
| PingFederate / generic | Whatever value you configured on the IdP side โ check your IdP’s assertion before assuming groups |
If group mapping appears to do nothing โ users log in successfully but no groups are created or assigned โ see Troubleshooting โ SAML group mapping does nothing below.
If no group with a matching name exists, DefectDojo will automatically create one and assign its members the Reader role. Note that this Reader role governs the member’s access to the group itself โ it does not grant any access to underlying Assets, Organizations, or other organizational assets. Those permissions are configured separately, and a newly auto-created group still has none of them until a Superuser assigns the group a role on the relevant Assets or Organizations.
To activate group mapping, check the Enable Group Mapping checkbox at the bottom of the form.
AWS IAM Identity Center
IAM Identity Center can act as the SAML IdP through a customer managed SAML 2.0 application.
- In the IAM Identity Center console, add a customer managed application of type SAML 2.0.
- Under IAM Identity Center metadata, download the IAM Identity Center SAML metadata file. Upload it to DefectDojo as Local SAML Metadata (step 8 of Setup), which works whether or not the instance can reach AWS.
- Under Application metadata, enter the values manually: set Application ACS URL to DefectDojo’s ACS URL and Application SAML audience to the Entity ID you set in DefectDojo.
- Under Attribute mappings, map the subject and the attributes DefectDojo reads. For example, send
${user:email}as the subject and as anemailattribute, and${user:givenName}and${user:familyName}as first and last name. Then map those attribute names to Email, First Name and Last Name in DefectDojo’s Attribute Mapping. The subject is theNameID, so it decides which DefectDojo account each person signs in to. - For group mapping, add an attribute such as
groupsmapped to${user:groups}, and enter the same name as DefectDojo’s Group Name Attribute. DefectDojo names its groups after the exact values in the assertion, so turn on Enable SAML Debugging for a test login and check what Identity Center sends before you write the Group Limiter Regex Expression. - Assign the users or groups who should have access to the application in IAM Identity Center.
To provision and deprovision users from your directory as well, see SCIM Provisioning.
Default access for SSO-provisioned users
When a new user is created via SAML (or any social-auth provider) and is not added to any group via SAML Group Mapping, they will land on a DefectDojo instance with no permissions. They will see zero Organizations, zero Assets, and zero Engagements when they log in โ the dashboard will appear empty.
To give every newly provisioned SSO user a sensible baseline, configure a Default group + Default group role on the System Settings page:
- Open Settings > System > System Settings (Superuser only).
- Set Default group to the User Group that newly created users should join.
- Set Default group role to the role they should hold in that group (e.g. Reader).
- Optionally set Default group email pattern to a regex (e.g.
.*@yourcompany\.com$) so the default group is only applied to users whose email matches. - Save.
Both Default group and Default group role must be set โ if either is empty, the default group is not applied.
This setting applies to every newly created user, including users created via SAML, OAuth, and other social-auth providers, because it runs on Django’s user-creation signal rather than inside a specific authentication backend.
Existing users are not affected. The default group is only applied when a user is first created. Existing DefectDojo users will keep their current group memberships even if you change this setting later.
Cloud vs On-Premise Differences
DefectDojo Cloud does not have the same level of SAML customization as DefectDojo On-Prem. The only variables that can be set are through the UI. Here are some of the key differences:
| Capability | Cloud | On-Premise |
|---|---|---|
| Username matching | NameID, or the attribute mapped to Username when Use Mapped Username is on | Same as Cloud (the SAML_USE_NAME_ID_AS_USERNAME env var applies to Open Source only, not Pro) |
| SAML assertion encryption | Not currently supported | Not currently supported |
| SAML login logs | SAML Login Attempts on the SAML settings page. Contact Support for the detailed debug log. | SAML Login Attempts on the SAML settings page, plus application container logs (docker logs dojo) |
| Configuration method | Pro UI (Connect > Authorization > Providers) only | Pro UI (Connect > Authorization > Providers), Django Admin, or Django Shell |
| Environment variables | Cannot be set by customers directly. Contact Support for changes. | Can be set via dojo-compose-cli environment add |
If you need to match users on an attribute other than NameID (such as uid or email), either configure your Identity Provider to send the desired value as the NameID, or map that attribute to Username and turn on Use Mapped Username.
Which account a login lands on
By default, a SAML login lands on the DefectDojo account whose username equals the NameID in the assertion. The Attribute Mapping only fills fields such as the email address and the names, and a row mapped to Username does not change which account is used.
To take the username from an attribute instead, map that attribute to Username and turn on Use Mapped Username. When the assertion carries a value for it, that value is the username used to find or create the account. When it does not, DefectDojo falls back to the NameID. Validate Config warns when the option is on but no row maps to Username.
Turning Use Mapped Username on changes which account an existing user signs in to. If your users’ current usernames came from the NameID and the mapped attribute holds a different value, their next login lands on a different account, or creates a new one when Create Unknown User is on. Check the mapping with one test user first, using SAML Login Attempts to confirm where the username came from.
Map only an attribute that your IdP sets and that users cannot edit themselves. Whoever controls that value chooses the DefectDojo account the login lands on, including an administrator account: a user who can change their own mapped value to admin would sign in as the local admin user.
With the option off:
- Have your IdP send each person’s DefectDojo username as the
NameID. Many organizations use the email address as the DefectDojo username and send the email as theNameID. - Use a persistent
NameIDformat. Transient issues a newNameIDon every login, so it never matches an existing account. - With Create Unknown User on, a
NameIDthat matches no username creates a new account. ANameIDthat differs from the username a person already has therefore creates a second account rather than signing them in to the first.
Troubleshooting
SAML Debugging output
When Enable SAML Debugging (in Additional Options) is checked, DefectDojo writes detailed SAML processing output โ including the raw attributes received from the IdP โ to the application logs at the DEBUG level under the saml2 logger.
| Where you’re running | Where to read the debug output |
|---|---|
| DefectDojo Cloud | The SAML debug log is not exposed in the UI. Contact DefectDojo Support to request the logs for a specific time window. |
| On-Premise (single container) | docker logs dojo (or your Helm/K8s log aggregation) |
| On-Premise (Helm/K8s) | kubectl logs deployment/defectdojo-django -c uwsgi (or your cluster’s log aggregator) |
Turn this option off after you’ve finished troubleshooting โ SAML debug logs are verbose and may contain sensitive attribute values from your IdP.
Users get a “User not found” or “Permission denied” error after a successful IdP login
If the SAML assertion parses successfully (no XML or signature errors) but DefectDojo refuses the login, the most common cause is a username mismatch between the IdP and DefectDojo.
By default DefectDojo looks up the user by the SAML NameID, which must equal an existing DefectDojo username (see Which account a login lands on). If the NameID your IdP sends does not match, the lookup fails even though the rest of the assertion is valid. Mapping a different attribute to Username does not help on its own: it is used to find the account only when Use Mapped Username is on.
Three remedies, pick whichever fits your environment:
- Change what the IdP sends as the
NameIDso it equals the DefectDojo username, for example the user’s email address. - Align the usernames. Make sure the usernames in DefectDojo are exactly the
NameIDvalues your IdP sends. For most organizations the easiest convention is to make DefectDojo usernames equal to the user’s email address, and have the IdP send the email as theNameID. - Use a mapped attribute. If the IdP already sends the DefectDojo username in an attribute, map it to Username and turn on Use Mapped Username.
If you’re not sure what the IdP is actually sending, open the attempt in SAML Login Attempts.
Names or email stay empty after login
Attribute Mapping rows match the attribute names in the assertion exactly, including case. If a row’s SAML Attribute is spelled differently from what the IdP sends (FirstName against firstName, or a friendly name against a full claim URI), the field it fills stays empty and no error is shown. Open the attempt in SAML Login Attempts: a row marked Missing is one whose attribute name was not among the accepted attributes, and the list of accepted names shows what to type instead.
See which attributes the IdP sent
The SAML Login Attempts panel at the bottom of the SAML settings page lists recent SAML logins. Expand an attempt to see, for every login that got as far as a decrypted assertion:
- the names of the attributes DefectDojo accepted from the assertion,
- each Attribute Mapping row, marked Found or Missing,
- whether the username came from the
NameIDor from the attribute mapped to Username.
With Allow Unknown Attributes off (the default), DefectDojo drops any attribute its attribute maps do not recognize before it reads the assertion, so those attributes are not in the list and rows that name them show as Missing. The attempt says so when this happened. Turn Allow Unknown Attributes on while troubleshooting to see every attribute the IdP sends.
Attribute values (email addresses, names, group memberships) are recorded only while Capture raw responses is on. It turns itself off after 24 hours. A login that fails before the assertion is decrypted, such as a signature failure, has no attribute information.
SAML group mapping does nothing โ users log in but no groups are assigned
The most common cause is a mismatch between the Group Name Attribute field and the attribute name your IdP is actually sending. See the Group Name Attribute by Identity Provider table above, and enable Enable SAML Debugging to see the raw attributes coming back from the IdP.