- some useful code from: https://code.google.com/p/oauth/
- for client and provider also