Dear community,
Recently I am working on a MFA project for my client by integrating CAS
with Authy. I am on the version 5.0.4. I have got into two issues during
this process.
Please check my configuration attached.
The first issue is that a NullPointerException occurs at supports() of
AbstractMultifactorAuthenticationProvider. The bypassEvaluator is null,
which causes the exception. I try to add a null check to get around this to
go ahead with the PoC at the moment.
The second issue is the user not valid exception during createUser in
AuthyClientInstance. Actually, I am using an Chinese phone number but the
country code is always default to the DEFAUT_COUNTRY_CODE which is “1”. If
I parse the phone number and try to create user with the country code, I am
able to finish the authentication.
* public* User getOrCreateUser(*final* Principal principal) {
*final* String email = (String) principal.getAttributes().get(*this*
.mailAttribute);
*if* (StringUtils.*isBlank*(email)) {
*throw* *new* IllegalArgumentException("No email address found
for " + principal.getId());
}
*final* String phone = (String) principal.getAttributes().get(*this*
.phoneAttribute);
*if* (StringUtils.*isBlank*(phone)) {
*throw* *new* IllegalArgumentException("No phone number found
for " + principal.getId());
}
PhoneNumberUtil phoneUtil = PhoneNumberUtil.*getInstance*();
PhoneNumber phoneNumber;
*try* {
phoneNumber = phoneUtil.parse(phone, Users.
*DEFAULT_COUNTRY_CODE*);
} *catch* (NumberParseException e) {
*throw* *new* IllegalArgumentException("Invalid phone
number found for " + principal.getId());
}
*return* *this*.authyUsers.createUser(email,
phoneNumber.getNationalNumber()
+ "", phoneNumber.getCountryCode() + "");
}
Are these issues are reported before? Or are there any other official ways
to handle this?
Thanks,
--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAOO6YXR%3DkjbvWN8ybTQSJP6Wb_p%3Dv72shLmPcCps75rPRpa-dA%40mail.gmail.com.
cas.properties
Description: Binary data
