0

I do need autheticate in podio by email & password, but everthing print "failed login" and oauthToken is equal to "nil"

I've tried with:

var podio = PKTClient(APIKey: idClient, secret: secretCode)

var tarea = podio.authenticateAsUserWithEmail(tFi_User.text, 
                                password: tFi_password.text)

if podio.isAuthenticated{
        println("succeed Login")
        println("\(podio.oauthToken)")
    }
else{
        println("failed login")
        println("\(podio.oauthToken)")
    }

then, I tried again with PodioKit class:

    PodioKit.setupWithAPIKey(idClient, secret: secretCode)

    PodioKit.authenticateAsUserWithEmail(tFi_User.text, 
                                        password: tFi_password.text)
    if PodioKit.isAuthenticated(){
        println("succeed Login")
    }
    else{
        println("failed login")
    }

but, I've got the same result: "failed login"

1 Answers1

0

This works for me:

PodioKit.setupWithAPIKey(idClient, secret: secretCode)
var podio = PKTClient.currentClient()

var tarea = podio.authenticateAsUserWithEmail(tFi_User.text, 
                                password: tFi_password.text)

if PodioKit.isAuthenticated(){
    println("succeed Login")
    println("\(podio.oauthToken)")
}
else{
    println("failed login")
    println("\(podio.oauthToken)")
}

then, prints the following:

 failed login
 nil
 succeed Login 
 &ltPKTOAuth2Token: 0x7f7f8bedea60&gt

Note the first login fails. The second login is OK.

I think that´s a Bug