Skip to content
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

[.NET SDK] No error is returned when user registration failed #397

Open
4 of 5 tasks
HobDev opened this issue Feb 8, 2025 · 2 comments
Open
4 of 5 tasks

[.NET SDK] No error is returned when user registration failed #397

HobDev opened this issue Feb 8, 2025 · 2 comments
Labels
bug Something is not working.

Comments

@HobDev
Copy link

HobDev commented Feb 8, 2025

Preflight checklist

Ory Network Project

https://kind-kapitsa-rmqphy91zf.projects.oryapis.com

Describe the bug

I am integrating Ory SDK in .NET Maui app. I started with registration flow. I tried multiple times to register with the following password:

Test@123

But each time I got null from the result. The registration code is:

new Ory.Client.Model.ClientUpdateRegistrationFlowBody
        (
            new ClientUpdateRegistrationFlowWithPasswordMethod
        (
            method: "password",
            password: registrationPassword,
                 traits: registrationTraits
        )
        );

        try
        {
            result = _frontendApi.UpdateRegistrationFlow(flowId, clientUpdateRegistrationFlowBody);
        }
        catch (ApiException e)
        {
            Debug.Print("Exception when calling FrontendApi.UpdateRegistrationFlow: " + e.Message);
            Debug.Print("Status Code: " + e.ErrorCode);
            Debug.Print(e.StackTrace);
        }

When I looked in the Logs & Events section of the Activity Tab in my Ory Network Project it says that the registration was failed. The json from the log:

{"name":"RegistrationFailed","timestamp":"2025-02-07T15:07:47Z","attributes":[{"key":"GeoLocationRegion","value":"WB"},{"key":"SelfServiceFlowType","value":"api"},{"key":"SelfServiceMethodUsed","value":""},{"key":"Reason","value":"the password does not fulfill the password policy because: The password has been found in data breaches and must no longer be used."},{"key":"FlowID","value":"2903936e-aafc-46fd-a609-ebf375c5ef55"},{"key":"ProjectEnvironment","value":"dev"},{"key":"GeoLocationCity","value":"Asansol"},{"key":"GeoLocationCountry","value":"IN"}]}
The sdk should get the error message when any flow fails in order to properly inform the app users.

Reproducing the bug

  1. Run the following repro project
  2. Try to register with any email and with password (Test@123)
  3. Put the breakpoint in the result of the UpdateRegistrationFlow(flowId, clientUpdateRegistrationFlowBody) method.

Relevant log output

Relevant configuration

Version

Ory.Client Version=1.16.2

On which operating system are you observing this issue?

None

In which environment are you deploying?

Ory Network

Additional Context

No response

@HobDev HobDev added the bug Something is not working. label Feb 8, 2025
@vinckr
Copy link
Member

vinckr commented Feb 9, 2025

Hello @HobDev

The error "the password does not fulfill the password policy because: The password has been found in data breaches and must no longer be used."

Please use a secure password instead of Test@123

@HobDev
Copy link
Author

HobDev commented Feb 10, 2025

Hello @vinckr

I used a secure password and successfully registered myself. But the api should return correct error message and error code so that the developer can inform the user about the mistake they are doing and/or take appropriate next steps in the app based on the error code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

2 participants