CloudFoundry's UAA has a RemoteTokenServices class (part of Spring oauth2 too) that does the authorization token validation by going to the UAA server's check_token endpoint. UAA has sample api and app applications that serve as a resource server and a client application respectively.
From the sample api's spring-servlet.xml:
<bean id="tokenServices" class="org.cloudfoundry.identity.uaa.oauth.RemoteTokenServices">
<property name="checkTokenEndpointUrl" value="${checkTokenEndpointUrl}" />
<property name="clientId" value="app" />
<property name="clientSecret" value="appclientsecret" />
</bean>
Do you know why this class (and the check_token endpoint that needs these values encoded in an Authorization header) needs a clientId and a clientSecret? It seems to me that it puts dependency on the client application from the resource server. How can I use multiple client applications if one of the client secrets is "hardcoded" here?