adaptivecomputing/grails-spring-security-oauth2-provider — pull request #38 by bobby-vandiver (2014-08-30 18:03:09+00:00)
Title: Improve authentication lookup

I took a look at the potential performance issue related to doing a full search for an access token based on the serialized `OAuth2Authentication` instance in `GormTokenStoreService.getAccessToken()` that @dynamind brought up in the other pull request. This pull request is basically a port of how Spring's [JdbcTokenStore](https://github.com/spring-projects/spring-security-oauth/blob/2.0.2.RELEASE/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/store/JdbcTokenStore.java) implementation handles this scenario.

This change uncovered a case where an authorization request could potentially be auto approved if the user has an existing access token. Spring OAuth 2.0.x has added an `ApprovalStore` that could also be used for auto approval, but there's no GORM backed implementation for this yet. I'll log an issue for that so it's tracked.

The complete functional test apps suite passes for all versions of Grails tested.