Functionality of Okta framework for iOS does not match documentation

I found following section in the iOS quickstart guide of the documentation:

When starting up the application, check for the existance of an access_token to see if the user has an existing session:

if let currentToken = OktaAuth.tokens.get(forKey: "accessToken") {
  // Token is valid!
} else {
  // Token does not exist, prompt the user to login.
}

The first problem is, that OktaAuth.tokens is of the type OktaTokenManager? => the example code would be wrong and needs to be something like this:

if let currentToken = OktaAuth.tokens?.get(forKey: "accessToken") {
  // Token is valid!
} else {
  // Token does not exist, prompt the user to login.
}

The second problem is, that the version with the optional OktaTokenManager will also not work as described in the documentation, because OktaAuth.tokens is never set when you don’t perform a login first. (And according to the documentation that unnecessary login call could be prevented by the check for an existing accessToken)


So here my questions:

  • Is the documentation out of date?
  • Did I use the API of the framework wrong?

I integrated v0.1.1 of OktaAuth via Cocoapods. So it should be the newest version available.

1 Like

Hi @dfelber,

Great catch. Currently, there is no easy way to manage a User’s session based on the exposed methods. I’ve created an issue on GitHub for the SDK here, so we can track the progress.

In the interm, I’ve updated the quickstart documentation as we resolve this.

1 Like

Is there an ETA on when this will get fixed? This is a big issue if a user has to login every time the app opens (especially when developing you have to rebuild the app every time you make a change). Or is there a way to work around this in the mean time?

I’m wondering if anyone is actually working on the iOS and Android frameworks.
There is no progress for months.

There is progress, I think looking at a single git repo is a little unfair though. The team owns a lot of different repos across web and mobile. Sometimes we see a problem, and we need to build in another area to fix the original problem. ID Token validation was a little bit more important for us to concentrate our efforts on and we released a spec compliant library: https://github.com/okta/okta-ios-jwt

Probably a little too much information, but I wanted to be clear about what we have been working on. We are working on a better way to describe timelines for features and issues in github so we have a simple way for our customers to figure timelines out on their own.

For this issue, in particular, this is slated for mid feb.