I have implemented OpenID on my website, so that a user can successfully use the system to authenticate.
However, it seems like the redirect from my site to the OpenID provider and the redirect from the provider back to my site takes a long time.
I am using PHP and the CodeIgniter framework, with the provided library on their wiki.
What might be slowing down this process and is there a way to speed it up?
Since an OpenID authentication goes back and forth between the OpenID provider and your server several times, the biggest delay usually comes from where your server is located relative to the OpenID server. Keep in mind that Stack Overflow is a heavily trafficked site with very fast servers, and likely so is the OpenID providers.
Your server on the other hand is probably not quite as fast, or possibly has a high latency to the OpenID provider. As such, about 5 seconds, 10 if really slow, doesn’t seem too unreasonable.
Try to profile every OpenID related communication to see if there’s anything you can speed up in your code, but that’s unlikely to be the bottleneck.