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

Swift Cannot read properties of undefined (reading ‘passwordless_method’) #770

Closed
5 tasks done
WorkspacePrateek opened this issue Jun 6, 2023 · 1 comment
Closed
5 tasks done
Labels
feature request A feature has been asked for or suggested by the community

Comments

@WorkspacePrateek
Copy link

Checklist

  • I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

Swift Cannot read properties of undefined (reading ‘passwordless_method’) while trying to login using email and password

Describe the ideal solution

Hello everyone,

I have been facing an issue while implementing Auth0 with a username and password authentication method. Every time I try to log in, the login fails, and I receive the following error message: “Cannot read properties of undefined (reading ‘passwordless_method’)”. Additionally, the status code returned is 500.

Here is the code snippet I am using for the login process:

Auth0
.authentication()
.login(
usernameOrEmail: "xxx@engrossinfotech.com",
password: "xxx@12345",
realmOrConnection: "Username-Password-XXXXXXXX",
audience: "https://company.com/api/v2/",
scope: "openid profile email offline_access"
)
.start { result in
switch result {
case .failure(let error):
print(error.localizedDescription)
case .success(let credentials):
print(credentials)
}
}

Alternatives and current workarounds

No response

Additional context

Note:

  • Version: Release 2.3.2
  • Mac M2 and M1
  • I have also tested the login functionality using WebAuth, and it worked without any issues.
  • I have also allowed the Password in the Grant Types.
    image
@WorkspacePrateek WorkspacePrateek added the feature request A feature has been asked for or suggested by the community label Jun 6, 2023
@WorkspacePrateek
Copy link
Author

Hello everyone,

I have identified the issue, and it is not related to the library. I am sharing the details here so that it can help anyone who may encounter a similar problem.

The web developers have implemented a rule that applies to all applications. Within that rule, there is a condition that checks if the passwordless_method parameter in the request has a value of 'SMS'. However, in the request I was sending from the mobile device, the parameter was not passwordless_method. As a result, the rule encountered an error, leading to the issues mentioned earlier.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature has been asked for or suggested by the community
Projects
None yet
Development

No branches or pull requests

1 participant