Closed erezrokah closed 4 months ago
OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-716406
@erezrokah Do you have the response that causes the error? for both AppUser.Profile and ApplicationGroupAssignment.Profile
Thanks for the quick response @duytiennguyen-okta, there's an example response in https://github.com/cloudquery/cloudquery/issues/16836#issuecomment-2037535304 for ApplicationGroupAssignment.Profile
but I was able to reproduce for AppUser.Profile
Example response from the API can be seen in https://developer.okta.com/docs/reference/api/apps/#response-example-32
The response I got looks like the one in the REST API docs, copying the one from the docs so the issue has all the information:
[
{
"id": "00ui2sVIFZNCNKFFNBPM",
"externalId": "005o0000000umnEAAQ",
"created": "2014-08-15T18:59:43.000Z",
"lastUpdated": "2014-08-15T18:59:48.000Z",
"scope": "USER",
"status": "PROVISIONED",
"statusChanged": "2014-08-15T18:59:48.000Z",
"passwordChanged": null,
"syncState": "SYNCHRONIZED",
"lastSync": "2014-08-15T18:59:48.000Z",
"credentials": {
"userName": "user@example.com"
},
"profile": {
"secondEmail": null,
"lastName": "McJanky",
"mobilePhone": "415-555-555",
"email": "user@example.com",
"salesforceGroups": [],
"role": "CEO",
"firstName": "Karl",
"profile": "Standard Platform User"
},
"_links": {
"app": {
"href": "https://{yourOktaDomain}/api/v1/apps/0oajiqIRNXPPJBNZMGYL"
},
"user": {
"href": "https://{yourOktaDomain}/api/v1/users/00ui2sVIFZNCNKFFNBPM"
}
}
},
{
"id": "00ujsgVNDRESKKXERBUJ",
"externalId": "005o0000000uqJaAAI",
"created": "2014-08-16T02:35:14.000Z",
"lastUpdated": "2014-08-16T02:56:49.000Z",
"scope": "USER",
"status": "PROVISIONED",
"statusChanged": "2014-08-16T02:56:49.000Z",
"passwordChanged": null,
"syncState": "SYNCHRONIZED",
"lastSync": "2014-08-16T02:56:49.000Z",
"credentials": {
"userName": "saml.jackson@example.com"
},
"profile": {
"secondEmail": null,
"lastName": "Jackson",
"mobilePhone": null,
"email": "saml.jackson@example.com",
"salesforceGroups": [
"Employee"
],
"role": "Developer",
"firstName": "Saml",
"profile": "Standard User"
},
"_links": {
"app": {
"href": "https://{yourOktaDomain}/api/v1/apps/0oajiqIRNXPPJBNZMGYL"
},
"user": {
"href": "https://{yourOktaDomain}/api/v1/users/00ujsgVNDRESKKXERBUJ"
}
}
}
]
@erezrokah
Thanks! No sensitive info the response it is copied from your docs
This issue has been marked stale because there has been no activity within the last 14 days. To keep this issue active, remove the stale
label.
Not stale
This issue has been marked stale because there has been no activity within the last 14 days. To keep this issue active, remove the stale
label.
Not stale
Describe the bug?
I believe the
Profile
type should bemap[string]interface{}
insteadmap[string]map[string]interface{}
, see of https://github.com/okta/okta-sdk-golang/blob/v4.0.0/okta/model_app_user.go#L46As a result JSON decoding of
AppUser
fails withcannot unmarshal string into Go struct field _AppUser.profile of type map[string]interface {}
What is expected to happen?
Listing application users should succeed
What is the actual behavior?
Listing application users fails
Reproduction Steps?
Use the
ListApplicationUsersExecute
APIAdditional Information?
Example response from the API can be seen in https://developer.okta.com/docs/reference/api/apps/#response-example-32
Golang Version
go version go1.22.1 darwin/arm64
SDK Version
v4.0.0
OS version
Darwin ****-MBP-2 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64