As requested, here is a site that shows both OpenID and the usual username / password on the same view: https://sourceforge.net/account/login.php
When you create such a page, it is completely normal so that unused form variables are empty. This does not make your code dirty. It simply represents what the user did: he entered the text in some fields and left the rest empty.
You can still validate the values โโprovided; you just need to add some logic to your controller. In pseudo code, it might look something like this:
if openid_identifier != "": validate_openid( openid_identifier) else: validate_password( username, password)
It is also worth noting that for OpenID providers that are known to support it, you can use the OpenID 2.0 identifier selection function and provide a simple button, instead of asking the user to dial its OpenID. See the specification for more details.
source share