Search in sources :

Example 1 with HOTPParams

use of com.sun.identity.authentication.modules.hotp.HOTPParams in project OpenAM by OpenRock.

the class DevicePrintModuleInitialiser method getHOTPService.

/**
     * Constructs an instance of the HOTPService.
     *
     * @param locale The user's locale.
     * @param amCache An instance of the AMResourceBundleCache.
     * @param userName The user's name.
     * @param amIdentityRepo An instance of the AMIdentityRepository.
     * @param options The authentication modules settings.
     * @return The HOTPService instance.
     */
public HOTPService getHOTPService(Locale locale, AMResourceBundleCache amCache, String userName, AMIdentityRepository amIdentityRepo, Map<String, String> options) {
    String gatewaySMSImplClass = CollectionHelper.getMapAttr(options, GATEWAY_SMS_IMPL_CLASS);
    String codeValidityDuration = CollectionHelper.getMapAttr(options, CODE_VALIDITY_DURATION);
    String codeLength = CollectionHelper.getMapAttr(options, CODE_LENGTH);
    String codeDelivery = CollectionHelper.getMapAttr(options, CODE_DELIVERY);
    String telephoneAttribute = CollectionHelper.getMapAttr(options, ATTRIBUTE_PHONE);
    String carrierAttribute = CollectionHelper.getMapAttr(options, ATTRIBUTE_CARRIER);
    String emailAttribute = CollectionHelper.getMapAttr(options, ATTRIBUTE_EMAIL);
    if (DEBUG.messageEnabled()) {
        DEBUG.message("HOTP.init() : " + "telephone attribute=" + telephoneAttribute);
        DEBUG.message("HOTP.init() : " + "carrier attribute=" + carrierAttribute);
        DEBUG.message("HOTP.init() : " + "email attribute=" + emailAttribute);
    }
    ResourceBundle bundle = amCache.getResBundle(AUTH_MODULE_NAME, locale);
    if (DEBUG.messageEnabled()) {
        DEBUG.message("HOTP.init() : " + "HOTP resouce bundle locale=" + locale);
    }
    HOTPParams hotpParams = new HOTPParams(gatewaySMSImplClass, Long.parseLong(codeValidityDuration), telephoneAttribute, carrierAttribute, emailAttribute, codeDelivery, options, Integer.parseInt(codeLength), bundle.getString("messageSubject"), bundle.getString("messageContent"), FROM_ADDRESS);
    return new HOTPService(amIdentityRepo, userName, hotpParams);
}
Also used : HOTPParams(com.sun.identity.authentication.modules.hotp.HOTPParams) HOTPService(com.sun.identity.authentication.modules.hotp.HOTPService) ResourceBundle(java.util.ResourceBundle)

Aggregations

HOTPParams (com.sun.identity.authentication.modules.hotp.HOTPParams)1 HOTPService (com.sun.identity.authentication.modules.hotp.HOTPService)1 ResourceBundle (java.util.ResourceBundle)1