Grant type 'http://auth0.com/oauth/grant-type/password-realm' not allowed for the client

My requirement is: User will enter his mobile number and we need to send OTP to that particular number and need to verify that. So that user can able to login

I took this as reference: Auth0.swift: Passwordless Authentication

While implementing step-2 am getting following error
Grant type ‘http://auth0.com/oauth/grant-type/password-realm’ not allowed for the client.

1 Like

Go to the Auth0 Dashboard > Applications > Your App > Show Advanced Settings > Grant Types.

Is the Password grant checked there?

6 Likes

Thanks for the quick reply. I check marked now
Now am getting this: Wrong email or password.

My code looks like below.
Am calling this(verifyOTP) method after entering OTP by user.
Am passing user’s mobile number to usernameOrEmail
and am passing user entered OTP to password
Am I doing anything wrong?

func verifyOTP(){
    Auth0
        .authentication()
        .login(
            usernameOrEmail: mobileTF.text!,
            password: OTPTF.text!,
            realm: "Username-Password-Authentication"
        )
        .start { result in
            switch result {
            case .success(let credentials):
                print("access_token: \(credentials.accessToken)")
            case .failure(let error):
                print(error)
            }
    }
}