/** {@inheritDoc} */
 public Set<String> validateRefreshTokenScope(
     ClientRegistration clientRegistration,
     Set<String> requestedScope,
     Set<String> tokenScope,
     OAuth2Request request)
     throws ServerException, InvalidScopeException {
   return scopeValidator.scopeRequestedForRefreshToken(
       requestedScope,
       clientRegistration.getAllowedScopes(),
       tokenScope,
       clientRegistration.getDefaultScopes());
 }
 /** {@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);
 }
    /** {@inheritDoc} */
    public void additionalDataToReturnFromTokenEndpoint(
        AccessToken accessToken, OAuth2Request request)
        throws ServerException, InvalidClientException, NotFoundException {

      final Map<String, String> data = new HashMap<String, String>();
      data.put("nonce", accessToken.getNonce());
      data.put(
          OAuth2Constants.Custom.SSO_TOKEN_ID,
          getSsoToken(ServletUtils.getRequest(request.<Request>getRequest())));

      final Map<String, Object> tokenEntries =
          scopeValidator.extraDataToReturnForTokenEndpoint(
              data, new LegacyAccessTokenAdapter(accessToken));

      if (tokenEntries != null) {
        for (final Map.Entry<String, Object> tokenEntry : tokenEntries.entrySet()) {
          accessToken.addExtraData(tokenEntry.getKey(), (String) tokenEntry.getValue());
        }
      }
    }
 /** {@inheritDoc} */
 public Map<String, Object> evaluateScope(AccessToken accessToken) {
   return scopeValidator.evaluateScope(new LegacyAccessTokenAdapter(accessToken));
 }
 /** {@inheritDoc} */
 public UserInfoClaims getUserInfo(AccessToken token, OAuth2Request request)
     throws UnauthorizedClientException {
   return scopeValidator.getUserInfo(new LegacyAccessTokenAdapter(token));
 }
 /** {@inheritDoc} */
 public Set<String> validateAuthorizationScope(
     ClientRegistration clientRegistration, Set<String> scope, OAuth2Request request)
     throws ServerException, InvalidScopeException {
   return scopeValidator.scopeToPresentOnAuthorizationPage(
       scope, clientRegistration.getAllowedScopes(), clientRegistration.getDefaultScopes());
 }