Describe the bug?
Similar/related to #516
The UserFactorVerifyResponse struct in the Okta Go SDK v6 incorrectly types the Profile field as map[string]map[string]interface{}, but the Okta API actually returns a flat object with string/null values for this field. This causes json.Unmarshal to fail when calling the Verify Factor endpoint for WebAuthn factors.
The bug is in the auto-generated struct in model_user_factor_verify_response.go:
|
Profile map[string]map[string]interface{} `json:"profile,omitempty"` |
The API returns profile as a flat map, e.g.:
{
"profile": {
"credentialId": "...",
"appId": null,
"version": null,
"authenticatorName": "Authenticator",
"presetPinAvailable": null,
"fulfillmentProvider": null
}
}
The values are strings and nulls — not nested maps — so the Go JSON decoder cannot unmarshal them into map[string]map[string]interface{}.
What is expected to happen?
Calling UserFactorAPI.VerifyFactor(...).Execute() for a WebAuthn factor should successfully deserialize the response, including the profile field.
What is the actual behavior?
The call returns an error:
json: cannot unmarshal string into Go struct field _UserFactorVerifyResponse.profile of type map[string]interface {}
This happens because the Profile field is typed as map[string]map[string]interface{} but the API returns flat string/null values (e.g. "credentialId": "abc"), which cannot be unmarshaled into a nested map type.
Reproduction Steps?
Enroll a WebAuthn factor for a user
Call the Verify Factor endpoint without a body to issue a challenge:
resp, apiResp, err := client.UserFactorAPI.VerifyFactor(ctx, userId, factorId).Execute()
// err is: json: cannot unmarshal string into Go struct field
// _UserFactorVerifyResponse.profile of type map[string]interface {}
Additional Information?
Suggested fix: Change the Profile field type from map[string]map[string]interface{} to map[string]interface{}, and update the corresponding getter/setter methods (GetProfile, GetProfileOk, SetProfile) accordingly.
This likely needs to be fixed in the OpenAPI spec that generates this SDK, since the model is auto-generated.
Golang Version
go version go1.26.1 darwin/arm64
SDK Version
github.com/okta/okta-sdk-golang/v6 v6.0.3
OS version
Darwin REDACTED.local 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:53:05 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T6020 arm64
Describe the bug?
Similar/related to #516
The
UserFactorVerifyResponsestruct in the Okta Go SDK v6 incorrectly types theProfilefield asmap[string]map[string]interface{}, but the Okta API actually returns a flat object with string/null values for this field. This causesjson.Unmarshalto fail when calling the Verify Factor endpoint for WebAuthn factors.The bug is in the auto-generated struct in
model_user_factor_verify_response.go:okta-sdk-golang/okta/model_user_factor_verify_response.go
Line 42 in 9f92d03
The API returns profile as a flat map, e.g.:
The values are strings and nulls — not nested maps — so the Go JSON decoder cannot unmarshal them into
map[string]map[string]interface{}.What is expected to happen?
Calling
UserFactorAPI.VerifyFactor(...).Execute()for a WebAuthn factor should successfully deserialize the response, including the profile field.What is the actual behavior?
The call returns an error:
This happens because the Profile field is typed as
map[string]map[string]interface{}but the API returns flat string/null values (e.g. "credentialId": "abc"), which cannot be unmarshaled into a nested map type.Reproduction Steps?
Enroll a WebAuthn factor for a user
Call the Verify Factor endpoint without a body to issue a challenge:
Additional Information?
Suggested fix: Change the Profile field type from map[string]map[string]interface{} to map[string]interface{}, and update the corresponding getter/setter methods (GetProfile, GetProfileOk, SetProfile) accordingly.
This likely needs to be fixed in the OpenAPI spec that generates this SDK, since the model is auto-generated.
Golang Version
go version go1.26.1 darwin/arm64
SDK Version
github.com/okta/okta-sdk-golang/v6 v6.0.3
OS version
Darwin REDACTED.local 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:53:05 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T6020 arm64