Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

All OAuth 2.0 requests are received by the OAuth2Servlet.  Per the spec, there are two OAuth 2.0 related endpoints: /oauth/authorize and /oauth/token.  The request is quickly delegated to either the OAuth2AuthorizationHandler or the OAuth2Token handler OAuth2TokenHandler accordingly.

The first thing either handler does is normalize the incoming OAuth 2.0 request using the OAuth2NormalizedRequest class.  This class is designed to receive the incoming HttpServletRequest and normalize all OAuth 2.0-related fields.  For example, a pre-registered client may authenticate using Basic Authentication or by including "client_secret" as a URL parameter.  These permutations make it difficult to process an incoming request consistently.  OAuth2NormalizedRequest will make the client secret accessible by getClientSecret() regardless of authentication method, thus "normalizing" the method that was used to authenticate, pass a token, pass a grant type, etc.

...