this.password = password;
}
@Override
public Tuple2<UserIdentityToken, SignatureData> getIdentityToken(EndpointDescription endpoint,
ByteString serverNonce) throws Exception {
<BUG>UserTokenPolicy tokenPolicy = Arrays.stream(endpoint.getUserIdentityTokens())
.filter(t -> t.getTokenType() == UserTokenType.UserName)</BUG>
.findFirst().orElseThrow(() -> new Exception("no username token policy found"));
String policyId = tokenPolicy.getPolicyId();
SecurityPolicy securityPolicy = SecurityPolicy.None;

this.password = password;
}
@Override
public Tuple2<UserIdentityToken, SignatureData> getIdentityToken(EndpointDescription endpoint,
ByteString serverNonce) throws Exception {
List<UserTokenPolicy> userIdentityTokens = l(endpoint.getUserIdentityTokens());
UserTokenPolicy tokenPolicy = userIdentityTokens.stream()
.filter(t -> t.getTokenType() == UserTokenType.UserName)
.findFirst().orElseThrow(() -> new Exception("no username token policy found"));
String policyId = tokenPolicy.getPolicyId();
SecurityPolicy securityPolicy = SecurityPolicy.None;
