berryboy

Can we make the oauth faster?

5 posts in this topic

I'm sharing what I discovered with your team and developers for suggestion.

These weeks, I've worked on Evernote OAuth authentication of my iPhone app. Since the username/password authentication is going to be deprecated on the 1st November.

After move to OAuth, I can easily noticed that login page took very long time to load every time I launched the app.

So, I tested Evernote login page with a profiler (on computer) and this is what I discovered.

Screen%20Shot%202555-09-20%20at%204.31.36%20PM.png

Loading javascript jQuery take 4 seconds and overall load time is almost 7 seconds. I had this test on coffee shop wifi, thus, I believed that it will be worse if the mobile apps are on unreliable network such as edge or 3G.

I think this is serious problem for third-party apps. Imagine that users launch an iPhone app for the first time, you require them to login, but they have to wait for login page (10+ seconds) before they can type anything.

PS. For comparison this's Facebook authentication page.

Screen%20Shot%202555-09-20%20at%204.34.59%20PM.png

Share this post


Link to post

Have there been any progress?

I also think this should be solved.

For the time being, I diddled the ENOAuthViewController.m to show a indicator while loading the web form.

1) Add a indicator property.


@property (nonatomic, retain) UIActivityIndicatorView *loadIndicator;
@synthesize loadIndicator = _loadIndicator;

2) Release the indicator in dealloc.

[_loadIndicator release];

3) Add two methods to show and hide the indicator at the center of the webView.



- (void)showIndicator
{
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
indicator.center = CGPointMake(self.webView.bounds.size.width / 2, self.webView.bounds.size.height / 2);
[self.webView addSubview:indicator];
[indicator startAnimating];
self.loadIndicator = indicator;
[indicator release];
}

- (void)hideIndicator
{
[_loadIndicator removeFromSuperview];
self.loadIndicator = nil;
}

4)Call showIndicator in webViewDidStartLoad: and call hideIndicator in both webViewDidFinishLoad: and webView:didFailLoadWithError:

ENOAuthViewController is not implemented webViewDidStartLoad: and webViewDidFinishLoad: so I added these two delegate methods.

Of course this is not a fundamental solution and this way requires me to modify the original source code every time the SDK is updated.

Share this post


Link to post

You'd have to wonder what jQuery was actually being used for - normally for web page manipulation. But finding some particular DOM Node might be doable without loading jQuery.

1 person likes this

Share this post


Link to post

Yes, I've also faced the same problem on Android. It takes a lot time for the login page to load (after the loading dialog disappears). Users think that there is something wrong with the app. We need to solve this issue as soon as possible.

Share this post


Link to post

We are looking into this. We have added some logs to the iOS SDK. If you can send us the log file (when OAuth is slow), that will be useful.

Share this post


Link to post