{
for (Callback callback : callbacks)
{
if (callback instanceof TokenCallback)
{
final TokenCallback tokenCallback = (TokenCallback) callback;
for (Object object : authRequest.getCredentials())
{
if (object instanceof SamlCredential)
{
try
{
tokenCallback.setToken(((SamlCredential)object).getAssertionAsElement());
}
catch (ProcessingException e)
{
log.error(e.getMessage(), e);
}