class RedisOAuth2AuthorizationConsentService implements OAuth2AuthorizationConsentService {

	private final RedissonClient redissonClient;;

	private final static Long TIMEOUT = 10L;

	@Override
	public void save(OAuth2AuthorizationConsent authorizationConsent) {
		Assert.notNull(authorizationConsent, "authorizationConsent cannot be null");

		redissonClient.getBucket(buildKey(authorizationConsent))
				.set(authorizationConsent, Duration.ofMinutes(TIMEOUT));
	}

	@Override
	public void remove(OAuth2AuthorizationConsent authorizationConsent) {
		Assert.notNull(authorizationConsent, "authorizationConsent cannot be null");
		redissonClient.getBucket(buildKey(authorizationConsent)).delete();
	}

	@Override
	public OAuth2AuthorizationConsent findById(String registeredClientId, String principalName) {<FILL_FUNCTION_BODY>}

	private static String buildKey(String registeredClientId, String principalName) {
		return "token:consent:" + registeredClientId + ":" + principalName;
	}

	private static String buildKey(OAuth2AuthorizationConsent authorizationConsent) {
		return buildKey(authorizationConsent.getRegisteredClientId(), authorizationConsent.getPrincipalName());
	}
}

		Assert.hasText(registeredClientId, "registeredClientId cannot be empty");
		Assert.hasText(principalName, "principalName cannot be empty");
		return (OAuth2AuthorizationConsent) redissonClient.getBucket(buildKey(registeredClientId, principalName)).get();
	
<no_super_class>