if (context != null && context.getIdentity() != null && tokenResolver != null) {
writeIdentity(context.getIdentityTokens(), new IdentityTokenIOAdapter() {
@Override
public void rewriteIdentityTokens(List<IdentityToken> identityTokens) {
tokenResolver.rewrite(identityTokens, response);
}
@Override
public boolean isRewriteSupported() {
return tokenResolver.isRewriteSupported();