/** {@inheritDoc} */
 public Map<String, String> additionalDataToReturnFromAuthorizeEndpoint(
     Map<String, Token> tokens, OAuth2Request request) {
   final Map<String, CoreToken> legacyTokens = new HashMap<String, CoreToken>();
   for (final Map.Entry<String, Token> token : tokens.entrySet()) {
     try {
       legacyTokens.put(token.getKey(), new LegacyCoreTokenAdapter(token.getValue()));
     } catch (ServerException e) {
       throw OAuthProblemException.OAuthError.SERVER_ERROR.handle(null, e.getMessage());
     }
   }
   return scopeValidator.extraDataToReturnForAuthorizeEndpoint(
       new HashMap<String, String>(), legacyTokens);
 }
 private void addServiceListener() {
   try {
     final SSOToken token = AccessController.doPrivileged(AdminTokenAction.getInstance());
     final ServiceConfigManager serviceConfigManager =
         new ServiceConfigManager(
             token, OAuth2ProviderService.NAME, OAuth2ProviderService.VERSION);
     if (serviceConfigManager.addListener(new OAuth2ProviderSettingsChangeListener()) == null) {
       logger.error(
           "Could not add listener to ServiceConfigManager instance. OAuth2 provider service "
               + "changes will not be dynamically updated for realm "
               + realm);
     }
   } catch (Exception e) {
     String message = "OAuth2Utils::Unable to construct ServiceConfigManager: " + e;
     logger.error(message, e);
     throw OAuthProblemException.OAuthError.SERVER_ERROR.handle(null, message);
   }
 }