How do we enable custom attributes for IDCS User Import and Export?

Hi,

Oracle IDCS provides schema management for us to define custom User attributes. After we define the custom User attributes, how can we enable them for User Import and Export?

In this article, I am going to cover the high-level steps for enablement.

For example, I created these 2 custom attributes (1 of type String, 1 of type String array) with these information in schema management -

######Attribute1#######

Display Name: color

Name: color

Data Type: String

Administrator permissions: Read-Write

End-user permissions: Read-Write

######Attribute2#######

Display Name: allColors

Name: allColors

Data Type: String array

Administrator permissions: Read-Write

End-user permissions: Read-Write


First of all, we need to use IDCS REST API to enable Custom Attribute for Import/Export

End point:

https://IDCSURL/admin/v1/Schemas/urn:ietf:params:scim:schemas:idcs:extension:custom:User

Operation: PATCH

Request Payload for custom attribute of String type:

{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations":
[
{
"op": "add",
"path": "attributes[name eq \"color\"].idcsCsvAttributeNameMappings",
"value": [ {
"columnHeaderName": "color",
"mapTo": "urn:ietf:params:scim:schemas:idcs:extension:custom:User:color"
}
]
}
]
}

Request Payload for custom attribute of String array type:

{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations":
[
{
"op": "add",
"path": "attributes[name eq \"allColors\"].idcsCsvAttributeNameMappings",
"value": [ {
"columnHeaderName": "allColors",
"mapTo": "urn:ietf:params:scim:schemas:idcs:extension:custom:User:allColors",
"multiValueDelimiter": ";"
}
]
}
]
}


To export user with custom attributes, we need to use REST API to submit a user export job then we can download the export file from the job detail page in IDCS 

End point:

https://IDCSURL/job/v1/JobSchedules

Operation: POST

Request Payload:

{
"schemas": ["urn:ietf:params:scim:schemas:oracle:idcs:JobSchedule"],
"jobType": "UserExport",
"runNow": true,
"parameters": [
{
"name": "exportFormat",
"value": "CSV"
}
]
}


To import user with custom attributes, we can use Import user action in Users UI. For the import sample file, I suggest to use the CSV file created from the export job. Although we can use sample file from Import users UI, but the sample file doesn't have custom attribute in the column header.


Till next time.
Adam


Oracle Doc Reference -
https://docs.oracle.com/en/cloud/paas/identity-cloud/rest-api/Exporting.html
https://docs.oracle.com/en/cloud/paas/identity-cloud/rest-api/settingcolnamevalue.html


Comments

Popular posts from this blog