Start a new topic
Answered

i keep getting error "Invalid credentials. Please retry your request with correct credentials"

Hi,


Im trying to create a new user.

after i upgraded from Kinvey iOS 1.0  to 3.3.5


i keep getting error "Invalid credentials. Please retry your request with correct credentials"


whenever i do the following code:


User.signup(username: "testing", password: "brasdfa", user: nil, client: Kinvey.sharedClient, completionHandler: { (newUser, error) in

 

                       if let tempUser = newUser {

                           print("user has logged in")

                        }

                       else{

                           print("user objct cant be accessed")

                        }

 

                       print(error);

 

 

                    })

 

 

Also what does user: parameter do?

 

i have a custom user class and whenever i placed its as user:MyCustomUserClass it gave me an error saying:

 

cannot convert value of type "MyCustomUserClass.Type" to expect argument type "User?"


Best Answer

Ivan,


Yes, please upgrade to the latest SDK version.
You are right, the other are dependencies. 


Thanks,

Pranav

Kinvey


Answer

Ivan,


Yes, please upgrade to the latest SDK version.
You are right, the other are dependencies. 


Thanks,

Pranav

Kinvey

Hi Pranav,


Here is my custom User Class


//

//

//  

//


import UIKit

import Kinvey

import ObjectMapper


class MyCustomUser: User {


    //    var email:          String = ""

    //    var password:       String = ""

    var fbToken:        String = ""

    var profilePic:     String = ""

    var profileImage:   UIImage? = nil

    var phone:          String = ""

    var Grp_Member:     String = ""

 

    //Tech User Model

    var first_Name:     String = ""

    var last_Name:      String = ""

    var streetAdd1:     String = ""

    var streetAdd2:     String = ""

    var city:           String = ""

    var state:          String = ""

    var zipCode:        String = ""

    var Country:        String = ""

 

    //W9 information

    var SSN:            String = ""

    var Tax_Id:         String = ""

    var Driver_License: String = ""

    var FL_Tech_License:String = ""

 

    override func mapping(map: Map) {

        super.mapping(map: map)

        fbToken <- map["fbToken"]

        profilePic <- map["profilePic"]

        profileImage <- map["profileImage"]

        phone <- map["phone"]

        Grp_Member <- map["Grp_Member"]

        first_Name <- map["first_Name"]

        last_Name <- map["last_Name"]

        streetAdd1 <- map["streetAdd1"]

        streetAdd2 <- map["streetAdd2"]

        city <- map["city"]

        state <- map["state"]

        zipCode <- map["zipCode"]

        Country <- map["Country"]

        SSN <- map["SSN"]

        Tax_Id <- map["Tax_Id"]

        Driver_License <- map["Driver_License"]

        FL_Tech_License <- map["FL_Tech_License"]

    }

}

 


Also im not sure i needed to enable email verification before when i was using 1.0 version of the SDK. i did however allowed for user to recover password using the email the provided.


In many ways the Username field is their email, I don't allow custom username entry. So you enter your email and that is your username.

Hi Pranav,


I ran pod Outdated

and it gives me the following Recommendations


- Kinvey 3.3.5 -> 3.3.7 (latest version 3.3.7)

- PromiseKit 4.1.3 -> 4.1.4 (latest version 4.1.4)

- Realm 2.1.2 -> 2.4.2 (latest version 2.4.2)

- RealmSwift 2.1.2 -> 2.4.2 (latest version 2.4.2)


and I Only have Kinvey in my Pod file as a dependency. Im assuming the others are Kinvey Dependencies,


Should i updated to .7? and also upgrade the other dependencies?


Sincerely


Ivan

Ivan,

  1. Have you enabled email verification but not providing email address during signup?
  2. Can you provide me with your custom user class definition?
  3. Also, please update the SDK to the latest i.e. 3.3.6. It's available here http://devcenter.kinvey.com/ios/downloads#


'user' parameter is for adding custom attributes to your custom user object while signing up. Check http://devcenter.kinvey.com/ios/guides/users#SignupwithAttributes

Thanks,
Pranav

Kinvey

Login or Signup to post a comment