Best I can suggest is a HTTP 401 status code with a WWW-Authenticate header.
The problem with 403 requests is the the RFC 2616 states "Authorization will not help and the request SHOULD NOT be repeated." (i.e. doesn't matter if you are authenticated or not, you are not going to get access to that resource, ever).
The problem with 401 requests is it states they "MUST include a WWW-Authenticate header field". As someone has noted it doesn't appear to be in violation of the spec to use a custom value in a WWW-Authenticate header.
I can't see any reason in RFC 2617 why an HTTP 401 status combined with a custom WWW-Authenticate header like this wouldn't be okay:
WWW-Authenticate: MyAuthScheme realm="http://example.com"
The oAuth spec actually seems to do just this, as they recommend this (though they have to my mind an odd interpretation of the RFC):
WWW-Authenticate: OAuth realm="http://server.example.com/"
This doesn't appear to be specifically SANCTIONED by the RFC, but I can't actually see that it's forbidden by it (it doesn't seem to conflict with any MUST or MUST NOT, SHOULD or SHOULD NOT condition).
I wish there was a more specific HTTP status code for timeouts and for things like CSRF tokens being invalid so this was clearer.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…