SpringSource/spring-security-oauth — pull request #84 by aanganes (2013-08-16 13:06:21+00:00)
Title: Added ImplicitGrantService, whicn mimics the AuthorizationCodeService pa...

...ttern used by the code flow. This allows the ImplicitTokenGranter to retrieve the original AuthorizationRequest, using the incoming TokenRequest as a key.

Without this service, the ImplicitTokenGranter has no reference to the original AuthorizationRequest. The AR may contain additional information not present in the TR, such as items in the extensions map. The additional information can be stored in an OAuth2Request, but because the ImplicitTokenGranter must adhere to the TokenGranter interface, there was no way to pass anything other than a TR to the granter. This new service saves the original AR (converted into an OAuth2Request for storage) alongside the newly created TR, in the AuthorizationEndpoint. This is similar to how the AuthorizationCodeFlow works. On the other side, the ImplicitTokenGranter removes the stored OA2R from the service, using the incoming TR as a key. It can then pass back an OAuth2Authentication object which contains a full copy of the original AR in its OA2R.