The HTTP spec states:
10.4.2 401 Unauthorized
The request requires user authentication. The response MUST include a WWW-A
According to RFC2617 the auth-scheme
can be anything; if you really want a 401 you're not technically breaking spec by making something up like WWW-Authenticate: OpenID realm="My Realm" location="http://my/login/location"
. Having said that, behaviour of other people's code when you do that is of course undefined. :-)
There is an OAuth Discovery spec that would indicate what to put into the WWW-Authenticate header -- if the spec were not obsolete without a replacement spec yet.