GET Security Roles

The GET /Security/Roles operation returns the list of security roles configured in Keyfactor Command. Query parameters support filtering using defined criteria, control over pagination by specifying the page number and return limit, and customization of sorting based on specified fields and order. On success, the operation returns HTTP 200 OK with  the details of the security roles.

Tip:  The following permissions (see Security Roles and Claims) are required to use this feature:

/security/read/

This operation has two available versions. Keyfactor strongly recommends using the newer operation when possible. The v1 operation has been deprecated since it supports Active Directory identities only. The v2 operation has been redesigned to provide support for alternate identity providers and the newer claims-based authentication model that accompanies this. This version of the operation supports both Active Directory and other identity providers. For more information, see Endpoint Definition Versioning.

Version 2 of GET /Security/Roles has been redesigned to provide support for alternate identity providers and the newer claims-based authentication model that accompanies this. All new development should use this version.

Table 785: GET Security Roles v2 Input Parameters

Name In Description
QueryString Query

A string containing a query to limit the results (for example, field1 -eq value1 AND field2 -gt value2). The default is to return all records. Fields available for querying through the API for the most part match those that appear in the Keyfactor Command Management Portal search dropdowns for the same feature. For querying guidelines, refer to: Searching Security Roles. The query fields supported for this operation are:

  • Name
PageReturned Query An integer that specifies how many multiples of the returnLimit to skip and offset by before returning results, to enable paging. The default is 1.
ReturnLimit Query An integer that specifies how many results to return per page. The default is 50. Very large values can result in long processing time.
SortField Query

A string containing the property by which the results should be sorted. Fields available for sorting through the API include:

  • EmailAddress
  • Id
  • Immutable
  • Name
  • PermissionSetId

Available sort fields are affected by the query provided in QueryString. The default sort field is  Name.

SortAscending Query An integer that sets the sort order on the returned results. A value of 0 sorts results in ascending order while a value of 1 sorts results in descending order. The default is ascending.

Table 786: GET Security Roles v2 Response Data

Name

Description

Id

An integer containing the Keyfactor Command identifier for the security role.

Name A string containing the short reference name for the security role.
EmailAddress A string containing an email address for the role. This address can be used from workflows to direct email messages to the owner of certificates for uses such as certificate expiration alerts (assuming the certificate owner for the certificates, a security role, has been populated)
Immutable A Boolean indicating if the role is immutable or not. Only the built-in Administrators role is considered immutable. The value of this parameter cannot be changed.
Permission SetId

A string containing the Keyfactor Command reference GUID of the permission set to which the role is assigned (see Permission Sets).

Tip:  For details of the permissions associated with the role, use the GET Security Roles ID operation for the desired role. For details of the permissions associated withe the permission set to which the role belongs, use the GET Permission Sets ID operation with this permission set GUID. A role may be only granted a subset of the permissions available in a permission set.
Enable Cert Ownership A Boolean indicating if the role can be assigned as a certificate owner (True or False). If this security role is expected to be an owner of any certificate, this flag must be True. If this value is set to False, this role will not appear when trying to assign an owner to a certificate.
Claims Count

An integer indicating the number of claims mapped to the role.

Tip:  For details of the claims associated with the role, use the GET Security Roles ID operation for the desired role.

Version 1 of GET /Security/Roles includes the same capabilities as version 2, but offers support for managing only legacy formatted Active Directory identities.

Important:  This version has been deprecated since it supports Active Directory identities only. It is retained for backwards compatibility, but all new development should use operations that provide support for alternate identity providers and the newer claims-based authentication model that accompanies this. These newer operations support both Active Directory and other identity providers. See version 2 of this operation.

Table 787: GET Security Roles v1 Input Parameters

Name In Description
Validate Query

A Boolean that specifies whether the optional parameter of validate is False, which allows the AuditXML validation to be skipped when loading records, or True (or not specified) in which case validation will occur. The default is True.

QueryString Query

A string containing a query to limit the results (for example, field1 -eq value1 AND field2 -gt value2). The default is to return all records. Fields available for querying through the API for the most part match those that appear in the Keyfactor Command Management Portal search dropdowns for the same feature. For querying guidelines, refer to: Searching Security Roles. The query fields supported for this operation are:

  • Name
PageReturned Query An integer that specifies how many multiples of the returnLimit to skip and offset by before returning results, to enable paging. The default is 1.
ReturnLimit Query An integer that specifies how many results to return per page. The default is 50. Very large values can result in long processing time.
SortField Query

A string containing the property by which the results should be sorted. Fields available for sorting through the API include:

  • Description

  • EmailAddress

  • Immutable
  • Name
  • PermissionSetId

Available sort fields are affected by the query provided in QueryString. The default sort field is  Name.

SortAscending Query An integer that sets the sort order on the returned results. A value of 0 sorts results in ascending order while a value of 1 sorts results in descending order. The default is ascending.

Table 788: GET Security Roles v1 Response Data

Name

Description

Id

An integer containing the Keyfactor Command identifier for the security role.

Name A string containing the short reference name for the security role.
Description A string containing the description for the security role.
EmailAddress A string containing an email address for the role. This address can be used from workflows to direct email messages to the owner of certificates for uses such as certificate expiration alerts (assuming the certificate owner for the certificates, a security role, has been populated).
Enabled

A Boolean that indicates whether the security role is active (True or False). Security roles that have been deactivated cannot be assigned to security identities. The default is True.

This is considered deprecated and may be removed in a future release.

Immutable A Boolean that indicates whether the security role has been marked as editable (False) or (True). Internal Keyfactor Command roles are not editable. This setting is reserved for Keyfactor Command internal use.
Valid A Boolean that indicates whether the security role's audit XML is valid (True or False). A security role may become invalid if Keyfactor Command determines that it appears to have been tampered with. This setting is not end-user configurable.
Private

A Boolean that indicates whether the security role has been marked private (True or False). The default is False.

This is considered deprecated and may be removed in a future release.

Permission SetId A string indicating the Keyfactor Command reference GUID of the permission set associated with the role (see Permission Sets).
Identities

An array of objects containing information about the security identities assigned to the security role. ClosedShow identity details.

Permissions

An array of strings containing the permissions assigned to the role in a comma-separated list of Name:Value pairs. See Legacy Security Structure for an overview of the possible permissions.

For example:

Copy
"Permissions": [
   "AdminPortal:Read",
   "Dashboard:Read"
],

Legacy Security Structure

The legacy security structure is documented in the tables below. It was completely replaced in Keyfactor Command version 11.0, but is retained for backwards compatibility for use with deprecated v1 security roles APIClosed An API is a set of functions to allow creation of applications. Keyfactor offers the Keyfactor API, which allows third-party software to integrate with the advanced certificate enrollment and management features of Keyfactor Command. operations, only.

Tip:  See the Keyfactor API Reference and Utility, which allows you to call API operations and view results. It is primarily intended for validation, testing, and workflowClosed A workflow is a series of steps necessary to complete a process. In Keyfactor Command, it refers to the workflow builder, which allows you to automate event-driven tasks such as when a certificate is requested, revoked or found in a certificate store. development, and also serves as an interactive supplement to this API documentation. You can access it from the help menu () in the Management Portal.