
GibranK.54400 (Customer) asked a question.
Hi to all,
I have assigned roles to a User through an API. I can able to see the assigned roles to a user through the API as well. But I am not able to get those roles in SAML Assertion Response. Can anybody please help me to get the user's ROLES information in SAML Assertion.
API to assign Role to User ==> https://dev-662098.okta.com/api/v1/users/00uqd2dd7fH9AnRc24x6/roles
API to list roles assigned to User => https://dev-662098.okta.com/api/v1/users/00uqd2dd7fH9AnRc24x6/roles
Response:-
[
{
"id": "ra1qukg2eH3J2U7cr4x6",
"label": "Super Organization Administrator",
"type": "SUPER_ADMIN",
"status": "ACTIVE",
"created": "2020-08-19T06:42:47.000Z",
"lastUpdated": "2020-08-19T06:42:47.000Z",
"assignmentType": "USER",
"_links": {
"assignee": {
"href": "https://dev-662098.okta.com/api/v1/users/00uqd2dd7fH9AnRc24x6"
}
}
}
]
Thanks in advance.

The roles of users can be retrieved with the following API Call:
GET {{url}}/api/v1/users/{{userId}}/roles
More details on the supported API Calls for roles can be found here:
https://developer.okta.com/docs/reference/api/roles/
Another option would be downloading the CSV from the Administrators Section of the Admin Panel by going to Security > Administrators > Download CSV
Unfortunately custom APi scripts falls out of Okta Support scope.
Additionally, you can find bellow the documentation for SAML tracer. When you start an IdP-initiated flow or SP-initiated flow while SAML tracer is enabled, it captures the SAML request and response
https://developer.okta.com/docs/guides/saml-tracer/overview/