Improve OpenId support

Needs review