• Resolved mloizos

    (@mloizos)


    Hello,

    I am using the following ruby code to register users in my db. The registration is successful. However, when I try to authenticate any of the registered user, I get the message, “Invalid username/email and/or password!”. Any ideas why this is happening? I am using the 2.8 version of the JSON Api User and the JSON Api Auth v 1.9.

    nonceUrl = ‘base_url/get_nonce/?controller=user&method=register’

    people.each do |f|
    puts f.username + ‘, ‘ + f.email + ‘, ‘ + f.displayName

    response = HTTParty.get(nonceUrl)
    responseString = response.body
    # puts responseString
    puts ‘Parsing json response for nonce…’

    json = JSON(responseString)
    puts json
    nonce = json[“nonce”]
    puts ‘Nonce is:’ + nonce

    userEmail = f.email
    username = f.username
    pass = Digest::MD5.hexdigest(‘12345678’)
    displayName = f.displayName

    registerUserUrl = ‘base_url/user/register/?username=’ + username + ‘&email=’ + userEmail + ‘&user-pass=’+ pass + ‘&insecure=cool&nonce=’ + nonce + ‘&display_name=’ + displayName

    registerResponse = HTTParty.get(registerUserUrl)
    puts registerResponse.body
    end

    I am trying to authenticate using:

    “base_url/user/generate_auth_cookie/?insecure=cool&email=\(username)&password=\(password)”

    Any ideas why this is not working anymore? I used to be able to authenticate a few days ago.

    I cannot login not even through the site’s wordpress login page.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ali Qureshi

    (@parorrey)

    please make sure you send request via POST method, see screenshots. if you send request via GET, # sign and some other symbols are not sent correctly.

    If you user is not working now and earlier was working, most probably, some recaptcha or other plugin might have stopped it or change your password.

    Thread Starter mloizos

    (@mloizos)

    Thanks for the reply.

    I had tried with a POST request but the result is the same.

    I think the issue probably belongs to the second case, as I could login without problems until recently. However, there is one user for whom the login still works – and I don’t think I have activated him manually. Have I got the correct understanding that after automatic registration of users there is no need for separate user activation? Would it be possible that the offending plugin/recaptcha affects only the registration phase?

    And how do you suggest that I find the offending plugin? By disabling all and then reenabling one by one?

    Plugin Author Ali Qureshi

    (@parorrey)

    And how do you suggest that I find the offending plugin? By disabling all and then reenabling one by one?

    Yes, this is the way to debug. sorry for replying late, I ever got the notification of your reply.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Invalid username/email and/or password!’ is closed to new replies.