@Override
	public AuthorizationRequest checkForPreApproval(	AuthorizationRequest authorizationRequest ,
														Authentication userAuthentication )
	{

		boolean approved = false;
		// If we are allowed to check existing approvals this will short circuit
		// the decision
		if ( useApprovalStore )
		{
			authorizationRequest = super
					.checkForPreApproval(	authorizationRequest ,
											userAuthentication );
			approved = authorizationRequest.isApproved();
		}
		else
		{
			if ( clientDetailsService != null )
			{
				Collection<String> requestedScopes = authorizationRequest
						.getScope();
				try
				{
					ClientDetails client = clientDetailsService
							.loadClientByClientId( authorizationRequest
									.getClientId() );
					for ( String scope : requestedScopes )
					{
						if ( client.isAutoApprove( scope ) || client
								.isAutoApprove( "all" ) )
						{
							approved = true;
							break;
						}
					}
				}
				catch ( ClientRegistrationException e )
				{
				}
			}
		}
		authorizationRequest.setApproved( approved );

		return authorizationRequest;

	}