Credential Types
Use the Credentials Types operations to create, read, and update the credential types used by compatible wallet apps.
|
You must ensure that any fields used in the |
Versioning
If the updated credential type differs from the existing credential type, the service saves the existing credential type as a Credential Type Version and increments version.number in the updated credential type. Credential Type Versions can be read with Read All Credential Type Versions.
Automatic deletion and revocation
Typical behavior for credential types is to automatically revoke user credentials when a credential type, user, or environment is deleted. However, some credential types, such as birth certificates, university degrees, or marriage certificates, should never be automatically revoked even if the user or environment is deleted. You control this using onDelete.revokeIssuedCredentials on the credential type.
The selected deletion and revocation behavior cascades over all resources managed by the service: credential types, issuance rules, staged changes, digital wallet applications, digital wallets, and user credentials.
Environment deleted:
-
Delete all credential types
-
Delete all issuance rules
-
Delete all staged changes
-
Delete all digital wallet applications
-
Delete all digital wallets
-
Delete all user credentials
-
Delete all provisioned credentials
-
Delete all credential type counts
-
Delete environment credential count
Population deleted:
-
Remove population from existing issuance rules
Group deleted:
-
Remove group from existing issuance rules
User deleted:
-
Delete user credential
-
Delete digital wallets
Application (associated with digital wallet applications) deleted:
-
No impact
Credential type deleted:
-
Revoke issued credentials based on delete flag
-
Delete issuance rule
Issuance rule deleted
-
Delete staged changes
Digital wallet application deleted:
-
Disable digital wallets that are of this type
Digital wallet deleted:
-
Revoke credentials that were provisioned to the digital wallet based on credential type delete flag
User credential deleted:
-
Revoke provisioned credentials based on credential type delete flag
Regardless of the setting of onDelete.revokeIssuedCredentials, the service always deletes any pending credentials. (Pending credentials are staged for issue but not provisioned to a wallet because no paired digital wallet exists.)
Credential schema
When the service creates a credential from a credential type, it maintains the full credential schema, including attributes without corresponding values in the Create a User Credential request, so that the credential structure is consistent and predictable. It assigns an empty string ("") to any attribute without a value in the request body.
Credential Types data model
| Property | Type | Required? | Mutable? | Description |
|---|---|---|---|---|
|
String |
Required |
Immutable |
An SVG formatted image containing placeholders for the credentials fields that need to be displayed in the image. Refer to warning following this table. Not returned with Read All Credential Types. You must Read One Credential Type with the |
|
String |
Optional |
Mutable |
A descriptor of the credential type. Can be non-identity types such as proof of employment or proof of insurance. |
|
DateTime |
N/A |
Read-only |
Date and time the credential type was created. |
|
DateTime |
N/A |
Read-only |
Date and time the credential type was deleted. Returned only with Read One Credential Type. |
|
String |
Optional |
Mutable |
A description of the credential type. |
|
String |
N/A |
Read-only |
PingOne environment identifier (UUID) in which the credential type exists. |
|
Object |
Optional |
Mutable |
Object that identifies how to evaluate the expiration date. Requires one and only one of |
|
Object |
Required/Optional |
Mutable |
Contains the numeric duration and its time unit for calculating an expiration date. |
|
Integer |
Required |
Mutable |
Length of time before transaction timeout expires; range is from a 1 hour minimum (or equivalent) to an (effectively) unbounded maximum. |
|
String |
Required |
Mutable |
Time unit of transaction timeout; can be |
|
String |
Required/Optional |
Mutable |
PingOne Expression Language (PEL) expression that evaluates to an ISO 8601 date. For more information on PEL, refer to PingOne expression language. |
|
String |
Required/Optional |
Mutable |
On issuance, name of the field in the credential to hold the |
|
DateTime |
Required/Optional |
Mutable |
The date and time to expire in ISO 8601 YYYY-MM-DDTHH:MM:SS.sssZ format (milliseconds optional). |
|
String |
Required |
Mutable |
Indicates how expiration of the credential is presented. Can be |
|
String |
N/A |
Read-only |
Identifier (UUID) associated with the credential type. |
|
String |
N/A |
Read-only |
The identifier (UUID) of the issuer. |
|
String |
Optional |
Mutable |
Issuer name associated with the card, can differ from title. |
|
String |
Optional |
Mutable |
Management mode of the credential type. Can be |
|
Object |
Required |
Mutable |
Contains the names, data types, and other metadata related to the credential; refer to metadata object data model. |
|
Object |
Optional |
Mutable |
Object containing directives that enable you to Issue multiple credentials to a user based on a directory attribute. |
|
String |
Required |
Mutable |
A PingOne Expression Language (PEL) expression that evaluates to a number or array. If an array, calculates the array length for the count. Populates the limit to a variable, |
|
Boolean |
Optional |
Mutable |
Whether user credentials are automatically revoked when a credential type, user, or environment is deleted. Defaults to |
|
String |
Required |
Immutable |
Title of the credential. Verification sites are expected to be able to request the issued credential from the compatible wallet app using the title. |
|
DateTime |
N/A |
Read-only |
Date and time the credential type was last updated; can be null. |
|
String |
N/A |
Read-only |
Identifier (UUID) of this version of the credential type. The service assigns identifiers. |
|
Integer |
N/A |
Read-only |
Version of this credential type. The service assigns versions. |
|
String |
N/A |
Read-only |
A URI to of this version of the credential type. The service assigns URIs. |
|
The design template, the SVG in |
|
Multiple credential issuance is limited to 10 credentials issued for one user for one credential type. You must ensure that the content of the directory attribute will not exceed the 10 credential limit when using your PEL expressions in |
If management.mode is AUTOMATED, the credential type is only issued by its associated credential issuance rule. If management.mode is MANAGED, the credential type is only issued by Create a User Credential or Update a User Credential API requests. If you change management.mode from AUTOMATED to MANAGED and an associated issuance rule exists, the rule is disabled, but not deleted.
If management.mode is AUTOMATED, you can value one and only one of the three properties in the expiration object and the associated credential issuance rule automatically assigns an expiration date when it issues the credential. If management.mode is MANAGED and an expiration object is present, it causes an error.
If you want to change management.mode from AUTOMATED to MANAGED, but one of the three properties in the expiration object is valued, you must remove the expiration object. Use Update the Credential Type with no expiration object, which removes it from the credential type, and with management.mode set to MANAGED.
|
For a credential type, if |
metadata object data model
The metadata object is not returned with Read All Credential Types. You must Read One Credential Type with the id of the credential type you want to review.
| Property | Type | Required? | Mutable? | Description |
|---|---|---|---|---|
|
String |
Optional |
Mutable |
URL to an image of the background to show in the credential. Must be no more than 50 KB in size. |
|
String |
Optional |
Mutable |
Percent opacity of the background image in the credential. High percentage opacity may make reading text difficult. |
|
String |
Optional |
Mutable |
Color to show on the credential. |
|
Integer |
Optional |
Mutable |
Number of columns of visible fields to use when displaying the credential. Must be between 1 and 3. Defaults to 1. |
|
String |
Optional |
Mutable |
Description of the credential. |
|
Object[] |
Optional |
Mutable |
Array of objects representing the fields. |
|
String |
Required/Optional |
Mutable |
Name of the PingOne Directory attribute. Required if |
|
String |
Optional |
Mutable |
Assigns a default value if a PingOne Expression Language (PEL) in the |
|
String |
Required |
Mutable |
Identifier of the field. Ping Identity recommends that |
|
String |
Optional |
Mutable |
Specifies how an image is stored in the credential; refer to fields.fileSupport types. |
|
Boolean |
Required |
Mutable |
Whether the field should be visible to viewers of the credential. |
|
Boolean |
Optional |
Mutable |
Whether the field is required for the credential. Defaults to |
|
String |
Required |
Mutable |
Descriptive text when showing the field. |
|
String |
Required |
Mutable |
Type of data in the field; refer to fields.type types. |
|
String |
Required/Optional |
Mutable |
The text to appear on the credential for a |
|
String |
Optional |
Mutable |
URL to an image of the logo to show in the credential. Must be no more than 25 KB in size. |
|
String |
Optional |
Mutable |
Name of the credential. |
|
String |
Optional |
Mutable |
Color of the text to show on the credential. |
|
Integer |
Optional |
Mutable |
Version of this credential metadata. If not provided, the service assigns a version. |
|
In a credential, the information is stored as name-value pairs where |
fields.attribute definition
Although fields.attribute is always a string type, the service supports two interpretations of its string.
If the string begins with ${ and ends with }, the string is interpreted as a PingOne Expression Language (PEL) expression. As a PEL expression, the string must have user. before any attribute names. A PEL expression is essential to xref:[Issue multiple credentials to a user based on a directory attribute]. The PEL expression extracts specific elements from the multiple potential credentials found in the attribute.
If the string does not have ${ and }, the string is interpreted as the traditional pointer to an attribute name in the directory. That is, you supply an attribute name as the string and the service supplies the value of that attribute to the credential. When used as a pointer, the string does not need user. to reference an attribute.
fields.fileSupport types
A credential field that uses a type of Directory Attribute can contain a URL that references a JPEG, PNG, or GIF image file uploaded with Create Image. The credential type is limited to 5 fields that have fileSupport set to BASE64_STRING or INCLUDE_FILE. For credentials, an image file has a maximum size of 2 MB. A credential cannot exceed 2.5 MB including all images.
|
If an image field is in the credential type, before issuing a credential you must:
|
| Type | Description |
|---|---|
BASE64_STRING |
Image is base64-encoded to a string in the credential. |
INCLUDE_FILE |
Image binary is included in the credential. |
REFERENCE_FILE |
Only a URL referencing the image is in the credential. The image binary remains stored external to the credential. |
fields.type types
| Type | Description |
|---|---|
Alphanumeric Text |
A static text string of letters, numbers, or punctuation set on |
Issued Timestamp |
Date and time the credential was issued. |
Directory Attribute |
Any PingOne Directory standard or custom attribute. When used in a credential for a user, the service reads that attribute from the user and puts the value in the credential. The name of the attribute is in |
Automatic deletion and revocation
Typical behavior for credential types is to automatically revoke user credentials when a credential type, user, or environment is deleted. However, some credential types, such as birth certificates, university degrees, or marriage certificates, should never be automatically revoked even if the user or environment is deleted. You control this using onDelete.revokeIssuedCredentials on the credential type.
The selected deletion and revocation behavior cascades over all resources managed by the service: credential types, issuance rules, staged changes, digital wallet applications, digital wallets, and user credentials.
If onDelete.revokeIssuedCredentials is true:
-
User credentials are revoked and deleted when the credential type is deleted.
-
Provisioned credentials are revoked when a user credential is deleted, its credential type is deleted, or its digital wallet is disabled or deleted.
If onDelete.revokeIssuedCredentials is false:
-
User credentials are only revoked if the issuance rule causes it to be revoked or if Update a User Credential sets the expiration date.
-
Provisioned credentials are revoked if the user credential is revoked (refer to previous item).
Issue multiple credentials to a user based on a directory attribute
Some customers must issue multiple credentials to a user based on a directory attribute. For example, a bank might issue credit cards in their own name while also issuing credit cards branded for their customers. A user may have more than one of these credit cards in their wallet. The directory service requires an attribute that contains all the credit cards for that user and the service must support credential issuance to any or all of that user’s credit cards.
The customer can define a single directory attribute for each user to hold a data object that contains the different accounts owned by the user. Our hypothetical bank wants to support the end user being able to present a verifiable credential that contains only the information from one of these accounts. Although issuance of multiple credentials is initiated by a single directory attribute, definition of the credential type can reference any directory attributes for its fields.
The definition of the data object is up to the customer. They then use PingOne Expression Language (PEL) expressions to retrieve any information as required. The Credential Types multiple.expression contains a PEL expression that counts qualifying entries in the data object. The Credential Types metadata.fields.attribute contains a PEL expression to retrieve individual data elements that populates a field in the credit type definition.
When you Apply Credential Issuance Rule Staged Changes for a user for a credential type that has multiple configured, the service creates multiple, separate user credentials for the credential type.
An example may better illustrate applying these concepts.
Example data object
Our hypothetical bank customer, BigBank, uses this JSON object, stored as a JSON binary large object (blob), as the source for credit card information.
{
"credit_cards": {
"branded": [
{
"oem_merchant": "ChainRetailer",
"customer_id": "0010380",
"user_id": "1506980157738"
},
{
"oem_merchant": "GlobalOil",
"customer_id": "0475932",
"user_id": "1506980157739"
}
],
"owned": [
{
"customer_id": "0010380",
"int_id" : "03918203198"
},
{
"customer_id": "0475932",
"int_id" : "03918203100"
}
]
}
}
An administrator at BigBank creates two different credential types, one each for branded and owned. Each credential type is configured to issue a credential for each JSON object in that array.
Example API
This demonstrates the API using the branded array. An administrator at BigBank created this credential type for branded.
A body for Create a credential type (automated) that creates multiple credentials from the data object for the credit_cards.branded is:
{
"title": "Branded Cards",
"description": "Example for branded cards attribute for BigBank",
"metadata": {
"fields": [
{
"id": "title",
"title": "oem_merchant",
"attribute": "${user.credit_cards['branded'][__ITERATOR__].oem_merchant}",
"isVisible": true,
"type": "Directory Attribute",
"default": "Use this if missing"
},
{
"id": "Directory Attribute -> user_id",
"title": "user_id",
"attribute": "${user.credit_cards['branded'][__ITERATOR__].user_id}",
"isVisible": true,
"type": "Directory Attribute"
},
{
"id": "Directory Attribute -> customer_id",
"title": "customer_id",
"attribute": "${user.credit_cards['branded'][__ITERATOR__].customer_id}",
"isVisible": true,
"type": "Directory Attribute"
}
]
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\">...</svg>",
"multiple": {
"expression": "${user.credit_cards['branded']}"
}
}
The PEL expression in multiple.expression returns the count of objects in the credit_cards.branded object array of the data object. This populates the iteration limit of the system ITERATOR variable seen in the PEL expressions of the three metadata.fields.attribute values.
A body for Create a credential type (automated) that creates multiple credentials from the data object for the credit_cards.owned is:
{
"title": "Owned",
"description": "Example for owned attribute for BigBank",
"metadata": {
"fields": [
{
"id": "Directory Attribute -> int_id",
"title": "int_id",
"attribute": "${user.credit_cards['owned'][__ITERATOR__].int_id}",
"isVisible": true,
"type": "Directory Attribute"
},
{
"id": "Directory Attribute -> customer_id",
"title": "customer_id",
"attribute": "${user.credit_cards['owned'][__ITERATOR__].customer_id}",
"isVisible": true,
"type": "Directory Attribute"
}
],
"textColor": "#000000",
"version": 4
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\">...</svg>",
"multiple": {
"expression": "${user.credit_cards['owned']}"
}
}
The PEL expression in multiple.expression returns the count of objects in the credit_cards.owned object array of the data object. This populates the iteration limit of the system ITERATOR variable seen in the PEL expressions of the two metadata.fields.attribute values.
Important considerations
-
Do not use a multi-valued attribute type. Use a single JSON attribute that contains the necessary arrays.
When configuring a custom JSON attribute for issuing multiple credentials for a user, the administrator can set it to a multi-valued type, which allows the attribute to be an array of JSON blobs. The PingOne Directory does not guarantee ordering for multi-valued attributes. Multi-valued attributes values are treated as a set rather than a list. This conflicts with how the service determines if a credential has changed, where order is essential. For example, a user has three credentials issued using a multi-valued type of [A, B, C]. If you add another JSON blob to the user attribute, one might expect the change to look like [A, B, C, D] (where each letter is a different credential) and issue one more credential to the user. However, with a multi-valued custom JSON attribute, the change may look like [A, C, D, B]. When the service compares the order, it interprets that two credentials have been updated and one more credential has been added.
Due to this involuntary re-ordering behavior, multi-valued custom JSON attributes are strongly discouraged.
-
Revocation can be affected by re-ordering.
If the user has an array like [A, B, C] so that the service issues three credentials and an administrator then revokes the credential B, credential B remains revoked. If the user is updated to change some values in A, B, and C, A and C update while B remains revoked. However, if the user is updated with a new object or value added to the array such that it becomes [A, D, B, C], credential C updates to the values of B and a new credential issues for C. No credential will be issued or updated to have the values of D because it is in the second place and the credential for second place was revoked.
To mitigate this behavior, always add new entries to the end of the arrays in the JSON blob.