resthub/resthub-spring-stack — pull request #87 by bclozel (2012-07-26 10:02:36+00:00)
Title: OAuth2.0 fix

Allow users to redefine OAuth2.0 token header key sent along resource requests.
Default value is "Bearer".

Implement auto-renewal of the OAuth2.0 token when it's expired.
I didn't implement this as a ResponseFilter because:
* RequestFilter and ResponseFilters are totally decoupled (so you can't modify the token store within the RequestFilter from the ResponseFilter)
* You can actuall receive HTTP Unauthorized responses for a lot of reasons (not only an expired token), and messing with the response can be an unpleasant surprise for RESThub's users
* A ResponseFilter can replay a request, but not issue a request AND replay the last request

Don't merge this pull request now. I'll probably modify it, I'm waiting for feedback on that matter.