private Element createSAMLAssertionWithClaimsProvider(
String tokenType, Crypto crypto, String signatureUsername, CallbackHandler callbackHandler
) throws WSSecurityException {
SAMLTokenProvider samlTokenProvider = new SAMLTokenProvider();
AttributeStatementProvider statementProvider = new CorrectedClaimsAttributeStatementProvider();
samlTokenProvider.setAttributeStatementProviders(Collections.singletonList(statementProvider));
TokenProviderParameters providerParameters =
createProviderParameters(
tokenType, STSConstants.BEARER_KEY_KEYTYPE, crypto, signatureUsername, callbackHandler
);