-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ory client-go 1.6.1: cannot deserialize continue_with response #330
Labels
bug
Something is not working.
Comments
I'm facing the exact same problem on Kratos v1.1.0. Here's my code. clientConf := client.NewConfiguration()
clientConf.HTTPClient = &http.Client{Timeout: 90 * time.Second}
clientConf.Servers = []client.ServerConfiguration{{URL: KratosEndpoint}}
kratos := client.NewAPIClient(clientConf)
registerFlow, _, err := kratos.FrontendAPI.CreateNativeRegistrationFlow(ctx).Execute()
if err != nil {
return nil, fmt.Errorf("cannot create reigstration flow: %w", err)
}
success, h, err := kratos.FrontendAPI.
UpdateRegistrationFlow(ctx).
UpdateRegistrationFlowBody(client.UpdateRegistrationFlowBody{
UpdateRegistrationFlowWithPasswordMethod: &client.UpdateRegistrationFlowWithPasswordMethod{
Method: "password",
Password: input.Password,
Traits: map[string]interface{}{
"emails": []string{input.Email},
// snip
},
},
}).
Flow(registerFlow.Id).
Execute()
if err != nil {
if h != nil {
respBody, _ := io.ReadAll(h.Body)
fmt.Println("respBody: ", string(respBody))
}
if success != nil {
fmt.Println("result payload: ", *success)
}
return nil, fmt.Errorf("cannot update registration flow: %w", err)
}
// read http response
if h != nil {
body, err := io.ReadAll(h.Body)
if err != nil {
return nil, fmt.Errorf("cannot read response body: %w", err)
}
defer h.Body.Close()
fmt.Println("body: ", string(body))
} Here's the response body. {
"session_token": "ory_st_qFoHeGWy7OBmDAkEaVFvKI8pjHXAcVHt",
"session": {
"id": "e20ca114-dacd-469b-855d-2bd160074a5b",
"active": true,
"expires_at": "2024-04-17T10:45:37.638992126Z",
"authenticated_at": "2024-03-18T10:45:37.639001314Z",
"authenticator_assurance_level": "aal1",
"authentication_methods": [
{
"method": "password",
"aal": "aal1",
"completed_at": "2024-03-18T10:45:37.638991746Z"
}
],
"issued_at": "2024-03-18T10:45:37.638992126Z",
"identity": {
"id": "99f99bd6-202b-401c-b18a-4eb3f7c50ae8",
"schema_id": "user_v0",
"schema_url": "https://kratos.digisense.dev/schemas/dXNlcl92MA",
"state": "active",
"state_changed_at": "2024-03-18T10:45:37.633852041Z",
"traits": {
"emails": [
"hzYdwAdmE5@whatever.com"
],
"name_display": "xxxx",
"name_full": "yyyy"
},
"verifiable_addresses": [
{
"id": "1c931d51-3aee-4dc1-b82a-bfbf190f3573",
"value": "hzydwadme5@whatever.com",
"verified": false,
"via": "email",
"status": "sent",
"created_at": "2024-03-18T10:45:37.635577Z",
"updated_at": "2024-03-18T10:45:37.635577Z"
}
],
"recovery_addresses": [
{
"id": "a72e3c37-4a35-43d9-832d-079e20316679",
"value": "hzydwadme5@whatever.com",
"via": "email",
"created_at": "2024-03-18T10:45:37.635959Z",
"updated_at": "2024-03-18T10:45:37.635959Z"
}
],
"metadata_public": null,
"created_at": "2024-03-18T10:45:37.635067Z",
"updated_at": "2024-03-18T10:45:37.635067Z",
"organization_id": null
},
"devices": [
{
"id": "b93710cc-2318-443e-bbb4-58cacbfbdc0c",
"ip_address": "",
"user_agent": "OpenAPI-Generator/1.0.0/go",
"location": ""
}
]
},
"identity": {
"id": "99f99bd6-202b-401c-b18a-4eb3f7c50ae8",
"schema_id": "user",
"schema_url": "https://snip/schemas/dXNlcl92MA",
"state": "active",
"state_changed_at": "2024-03-18T10:45:37.633852041Z",
"traits": {
"emails": [
"hzYdwAdmE5@whatever.com"
],
},
"verifiable_addresses": [
{
"id": "1c931d51-3aee-4dc1-b82a-bfbf190f3573",
"value": "hzydwadme5@whatever.com",
"verified": false,
"via": "email",
"status": "sent",
"created_at": "2024-03-18T10:45:37.635577Z",
"updated_at": "2024-03-18T10:45:37.635577Z"
}
],
"recovery_addresses": [
{
"id": "a72e3c37-4a35-43d9-832d-079e20316679",
"value": "hzydwadme5@whatever.com",
"via": "email",
"created_at": "2024-03-18T10:45:37.635959Z",
"updated_at": "2024-03-18T10:45:37.635959Z"
}
],
"metadata_public": null,
"created_at": "2024-03-18T10:45:37.635067Z",
"updated_at": "2024-03-18T10:45:37.635067Z",
"organization_id": null
},
"continue_with": [
{
"action": "show_verification_ui",
"flow": {
"id": "945106bb-b15c-404a-a7a5-b1394868f09b",
"verifiable_address": "hzydwadme5@whatever.com"
}
},
{
"action": "set_ory_session_token",
"ory_session_token": "ory_st_qFoHeGWy7OBmDAkEaVFvKI8pjHXAcVHt"
}
]
} Here's the result from my test
|
This should be resolved with the newest versions of the Ory SDK! |
We have released the latest version of the SDK as all the pipeline issues have been fixed. This should be addressed now by upgrading the package :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preflight checklist
Ory Network Project
No response
Describe the bug
I'm using the native version of the self service recovery. The Ory client (golang) cannot deserialize the continue_with field.
Reproducing the bug
Trigger the recovery flow
Update the recovery flow with code method
Update (finish) the recovery flow by sending the code
Error:
data matches more than one schema in oneOf(ContinueWith)
Relevant log output
Relevant configuration
Version
1.6.1
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Docker Compose
Additional Context
No response
The text was updated successfully, but these errors were encountered: