class SAPOfflineTokenServicesCloud implements ResourceServerTokenServices, InitializingBean {

	@Override
	public OAuth2Authentication loadAuthentication(@Nonnull String accessToken)
			throws AuthenticationException, InvalidTokenException {
		Token token = checkAndCreateToken(accessToken);

		ValidationResult validationResult = tokenValidator.validate(token);

		if (validationResult.isErroneous()) {
			throw new InvalidTokenException(validationResult.getErrorDescription());
		}
		SecurityContext.setToken(token);

		String tokenClientId = token.getClaimAsString(TokenClaims.XSUAA.CLIENT_ID);
		if (LOGGER.isInfoEnabled() && tokenClientId != serviceConfiguration.getClientId()) {
			LOGGER.info("Creates OAuth2Authentication with token clientId {} which differs from oauth client id {}.",
					tokenClientId, serviceConfiguration.getClientId());
		}
		// remoteUser support: NGPBUG-125268
		return createOAuth2Authentication(tokenClientId, getScopes(token), token);
	}

	public  SAPOfflineTokenServicesCloud();
	public  SAPOfflineTokenServicesCloud(OAuth2ServiceConfiguration serviceConfiguration);
	public  SAPOfflineTokenServicesCloud(OAuth2ServiceConfiguration serviceConfiguration,
			RestOperations restOperations);
	  SAPOfflineTokenServicesCloud(OAuth2ServiceConfiguration serviceConfiguration,
			JwtValidatorBuilder jwtValidatorBuilder);

}