use of net.phonefactor.pfsdk.PlainTextPinInfo in project cas by apereo.
the class AzureAuthenticatorAuthenticationRequestBuilder method build.
/**
* Build pf auth params.
*
* @param p the principal
* @param c the credential/token
* @return the pf auth params
*/
public PFAuthParams build(final Principal p, final AzureAuthenticatorTokenCredential c) {
if (!p.getAttributes().containsKey(this.phoneAttributeName)) {
throw new IllegalArgumentException(this.phoneAttributeName + " is not available as a principal attribute");
}
final PFAuthParams params = new PFAuthParams();
params.setPhoneNumber(p.getAttributes().get(this.phoneAttributeName).toString());
params.setCountryCode("1");
params.setUsername(p.getId());
switch(mode) {
case PIN:
params.setAuthInfo(new PlainTextPinInfo(c.getToken()));
break;
case POUND:
default:
params.setAuthInfo(new StandardPinInfo());
}
return params;
}
Aggregations