You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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) } }
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.
Checklist
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:
The text was updated successfully, but these errors were encountered: