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

Add support for email verification_method in ConnectionOptions #788

Closed

Conversation

hdmoreland
Copy link

Changes

Please describe both what is changing and why this is important. Include:

This PR adds support for the verification_method property on the ConnectionOptionsEmailAttribute class, allowing developers to specify whether email verification should use a magic link ("link") or a one-time password ("otp").

Specifically:

  • Added a new ConnectionOptionsEmailVerificationMethod enum with Link and Otp values
  • Added a new VerificationMethod property to the ConnectionOptionsEmailAttribute class

This change is important because the Auth0 Management API supports configuring email verification methods, but the .NET SDK currently lacks this capability. This forces developers to either use direct HTTP calls or be limited to the default magic link verification.

References

Issue #787

The Auth0 Management API documentation showing the verification_method property:
https://auth0.com/docs/api/management/v2#!/Connections/post_connections

Testing

The change has been manually tested on the latest version of the platform to verify:

  • Proper serialization of the verification_method property when creating connections
  • The Auth0 API correctly accepts and processes the property
  • Creating connections with both "link" and "otp" verification methods works as expected

I didn't add automated tests because:

  • The change is limited to adding a property to an existing model class

  • Similar model properties in the codebase generally don't have dedicated unit tests

  • This change adds unit test coverage

  • This change adds integration test coverage

  • This change has been tested on the latest version of the platform/language or why not

Checklist

@hdmoreland hdmoreland requested a review from a team as a code owner March 4, 2025 17:09
@hdmoreland
Copy link
Author

@kailash-b Are you able to review this?

@kailash-b
Copy link
Contributor

Hi @hdmoreland
Apologies for the delay in response and thank you for taking time contributing to the repo.

I did go through the changes and they look good.
Just had a couple of minor things we need to address before we can merge.

  1. According to our recently updated contribution guidelines, we need the commits to be signed before we can merge. Please ensure your commit is signed.

  2. Regarding the test cases, we do agree there are not many unit test cases.
    However, there are a bunch of integration test cases that test the different flows we support.
    Since you might not be able to run the test cases on your local (requires a tenant with some pre-requisites), I tried running the integration test cases on my local with one small addition to cover this new field in Test_connection_crud_sequence test case.
    Can you please include this change as well in your commits?

https://github.com/auth0/auth0.net/blob/master/tests/Auth0.ManagementApi.IntegrationTests/ConnectionTests.cs#L495

                    Email = new ConnectionOptionsEmailAttribute()
                    {
                        ProfileRequired = false,
                        Identifier = new ConnectionOptionsAttributeIdentifier()
                        {
                            Active = true
                        },
                        Signup = new ConnectionOptionsEmailSignup()
                        {
                            Status = ConnectionOptionsAttributeStatus.Optional,
                            Verification = new ConnectionOptionsVerification()
                            {
                                Active = false
                            }
                        },
                        VerificationMethod = ConnectionOptionsEmailVerificationMethod.Otp  -->  Adding the new field with a valid value.
                    },

@kailash-b
Copy link
Contributor

Thanks for taking time contributing.
Changes included as part of #792

@kailash-b kailash-b closed this Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants