I had this same problem and as Aaron says it was related to the callback URL. I was using domain mapping in a multi-site setup and the solution was to use the https://blogs.domain.com/blogname address rather than the mapped domain name https://www.blogname.com.
Hope this helps someone else.