Search in sources :

Example 1 with ScriptTextOutputCallback

use of com.sun.identity.authentication.callbacks.ScriptTextOutputCallback in project OpenAM by OpenRock.

the class AuthenticatorOATH method createQRCodeCallback.

/**
    * There is a hack here to reverse a hack in RESTLoginView.js. Implementing the code properly in RESTLoginView.js so
    * as to remove this hack will take too long at present, and stands in the way of completion of this module's
    * QR code additions. I have opted to simply reverse the hack in this singular case.
    *
    * In the below code returning the ScriptTextOutputCallback, the String used in its construction is
    * defined as follows:
     *
    * createQRDomElementJS
    *           Adds the DOM element, in this case a div, in which the QR code will appear.
    * QRCodeGenerationUtilityFunctions.
    *   getQRCodeGenerationJavascriptForAuthenticatorAppRegistration(authenticatorAppRegistrationUri)
    *           Adds a specific call to the Javascript library code, sending the app registration url as the
    *           text to encode as a QR code. This QR code will then appear in the previously defined DOM
    *           element (which must have an id of 'qr').
    * hideButtonHack
    *           A hack to reverse a hack in RESTLoginView.js. See more detailed comment above.*
    */
private Callback createQRCodeCallback(OathDeviceSettings settings, AMIdentity id, int callbackIndex) throws AuthLoginException {
    try {
        final String authenticatorAppRegistrationUri = getAuthenticatorAppRegistrationUri(settings, id);
        final String callback = "callback_" + callbackIndex;
        return new ScriptTextOutputCallback(GenerationUtils.getQRCodeGenerationJavascriptForAuthenticatorAppRegistration(callback, authenticatorAppRegistrationUri));
    } catch (IOException e) {
        throw new AuthLoginException(amAuthOATH, "authFailed", null);
    }
}
Also used : AuthLoginException(com.sun.identity.authentication.spi.AuthLoginException) ScriptTextOutputCallback(com.sun.identity.authentication.callbacks.ScriptTextOutputCallback) IOException(java.io.IOException)

Example 2 with ScriptTextOutputCallback

use of com.sun.identity.authentication.callbacks.ScriptTextOutputCallback in project OpenAM by OpenRock.

the class AuthXMLUtils method createTextOutputCallback.

static TextOutputCallback createTextOutputCallback(Node childNode, Callback callback) {
    TextOutputCallback textOutputCallback = null;
    if (callback != null) {
        if (callback instanceof TextOutputCallback) {
            textOutputCallback = (TextOutputCallback) callback;
        }
    }
    if (textOutputCallback == null) {
        String value = getValue(childNode);
        int messageType = 0;
        String msgType = XMLUtils.getNodeAttributeValue(childNode, AuthXMLTags.MESSAGE_TYPE);
        if (msgType.equals("script")) {
            textOutputCallback = new ScriptTextOutputCallback(value);
        } else {
            if (msgType.equals("information")) {
                messageType = TextOutputCallback.INFORMATION;
            } else if (msgType.equals("error")) {
                messageType = TextOutputCallback.ERROR;
            } else if (msgType.equals("warning")) {
                messageType = TextOutputCallback.WARNING;
            }
            textOutputCallback = new TextOutputCallback(messageType, value);
        }
    }
    return textOutputCallback;
}
Also used : ScriptTextOutputCallback(com.sun.identity.authentication.callbacks.ScriptTextOutputCallback) TextOutputCallback(javax.security.auth.callback.TextOutputCallback) ScriptTextOutputCallback(com.sun.identity.authentication.callbacks.ScriptTextOutputCallback)

Example 3 with ScriptTextOutputCallback

use of com.sun.identity.authentication.callbacks.ScriptTextOutputCallback in project OpenAM by OpenRock.

the class AMLoginModule method cloneCallbacks.

/**
     * Clone Callback[], and save it in the internal/external
     * callbacks list. External callback contains all user defined
     * Callbacks in the xml module configuration (property file),
     * internal callback contains the external callbacks plus the
     * PagePropertiesCallback. Note here, although
     * Callback[] in internal/external are different, the Callback
     * instance they pointed are actually same instance
     * @param index indicates state of callback
     * @param original original array of callback to be cloned
     * @return Callback[] returns cloned callback
     * @exception AuthLoginException if callback can not be cloned
     */
private Callback[] cloneCallbacks(int index, Callback[] original) throws AuthLoginException {
    // check if there is any callbacks in original
    if (original == null || original.length == 0) {
        // this is the error case where there is no Callbacks
        // defined for a state
        debug.error("cloneCallbacks, no callbacks in state " + (index + 1));
        throw new AuthLoginException(bundleName, "noCallbackState", new Object[] { new Integer(index + 1) });
    }
    int len = original.length;
    // Callback array which hold the cloned Callbacks
    Callback[] copy = new Callback[len];
    // List which contains the external callbacks only
    List extCallbacks = new ArrayList();
    // if it is an external Callback, add to the extCallback list
    for (int i = 0; i < len; i++) {
        if (original[i] instanceof HiddenValueCallback) {
            final HiddenValueCallback hiddenValueCallback = (HiddenValueCallback) original[i];
            String defaultValue = hiddenValueCallback.getDefaultValue();
            if (defaultValue != null && defaultValue.length() != 0) {
                copy[i] = new HiddenValueCallback(hiddenValueCallback.getId(), defaultValue);
            } else {
                copy[i] = new HiddenValueCallback(hiddenValueCallback.getId());
            }
            extCallbacks.add(copy[i]);
            if (debug.messageEnabled()) {
                debug.message("clone #" + i + " is HiddenValueCallback");
            }
        } else if (original[i] instanceof NameCallback) {
            String dftName = ((NameCallback) original[i]).getDefaultName();
            if (dftName != null && dftName.length() != 0) {
                copy[i] = new NameCallback(((NameCallback) original[i]).getPrompt(), dftName);
            } else {
                copy[i] = new NameCallback(((NameCallback) original[i]).getPrompt());
            }
            extCallbacks.add(copy[i]);
            if (debug.messageEnabled()) {
                debug.message("clone #" + i + " is NameCallback");
            }
        } else if (original[i] instanceof PasswordCallback) {
            copy[i] = new PasswordCallback(((PasswordCallback) original[i]).getPrompt(), ((PasswordCallback) original[i]).isEchoOn());
            extCallbacks.add(copy[i]);
            if (debug.messageEnabled()) {
                debug.message("clone #" + i + " is PasswordCallback");
            }
        } else if (original[i] instanceof ScriptTextOutputCallback) {
            copy[i] = new ScriptTextOutputCallback(((TextOutputCallback) original[i]).getMessage());
            extCallbacks.add(copy[i]);
            if (debug.messageEnabled()) {
                debug.message("clone #" + i + " is ScriptTextOutputCallback");
            }
        } else if (original[i] instanceof TextOutputCallback) {
            copy[i] = new TextOutputCallback(((TextOutputCallback) original[i]).getMessageType(), ((TextOutputCallback) original[i]).getMessage());
            extCallbacks.add(copy[i]);
            if (debug.messageEnabled()) {
                debug.message("clone #" + i + " is TextOutputCallback");
            }
        } else if (original[i] instanceof PagePropertiesCallback) {
            // PagePropertiesCallback, no need to add to external callbacks
            copy[i] = new PagePropertiesCallback(((PagePropertiesCallback) original[i]).getModuleName(), ((PagePropertiesCallback) original[i]).getHeader(), ((PagePropertiesCallback) original[i]).getImage(), ((PagePropertiesCallback) original[i]).getTimeOutValue(), ((PagePropertiesCallback) original[i]).getTemplateName(), ((PagePropertiesCallback) original[i]).getErrorState(), ((PagePropertiesCallback) original[i]).getPageState());
            ((PagePropertiesCallback) copy[i]).setRequire(((PagePropertiesCallback) original[i]).getRequire());
            ((PagePropertiesCallback) copy[i]).setAttribute(((PagePropertiesCallback) original[i]).getAttribute());
            ((PagePropertiesCallback) copy[i]).setInfoText(((PagePropertiesCallback) original[i]).getInfoText());
            if (debug.messageEnabled()) {
                debug.message("clone #" + i + " is PagePropertiesCallback");
            }
        } else if (original[i] instanceof ChoiceCallback) {
            ChoiceCallback originalChoiceCallback = (ChoiceCallback) original[i];
            ChoiceCallback clone = new ChoiceCallback(originalChoiceCallback.getPrompt(), originalChoiceCallback.getChoices(), originalChoiceCallback.getDefaultChoice(), originalChoiceCallback.allowMultipleSelections());
            if (originalChoiceCallback.getSelectedIndexes() != null && originalChoiceCallback.getSelectedIndexes().length > 0) {
                if (originalChoiceCallback.allowMultipleSelections()) {
                    clone.setSelectedIndexes(originalChoiceCallback.getSelectedIndexes());
                } else {
                    clone.setSelectedIndex(originalChoiceCallback.getSelectedIndexes()[0]);
                }
            }
            copy[i] = clone;
            extCallbacks.add(copy[i]);
            if (debug.messageEnabled()) {
                debug.message("clone #" + i + " is ChoiceCallback");
            }
        } else if (original[i] instanceof ConfirmationCallback) {
            ConfirmationCallback temp = (ConfirmationCallback) original[i];
            String prompt = temp.getPrompt();
            String[] options = temp.getOptions();
            if (prompt == null) {
                // no prompt
                if (options == null) {
                    // no options
                    copy[i] = new ConfirmationCallback(temp.getMessageType(), temp.getOptionType(), temp.getDefaultOption());
                } else {
                    copy[i] = new ConfirmationCallback(temp.getMessageType(), options, temp.getDefaultOption());
                }
            } else {
                // has prompt
                if (options == null) {
                    // no options
                    copy[i] = new ConfirmationCallback(prompt, temp.getMessageType(), temp.getOptionType(), temp.getDefaultOption());
                } else {
                    copy[i] = new ConfirmationCallback(prompt, temp.getMessageType(), options, temp.getDefaultOption());
                }
            }
            extCallbacks.add(copy[i]);
            if (debug.messageEnabled()) {
                debug.message("clone #" + i + " is ConfirmationCallback");
            }
        } else if (original[i] instanceof TextInputCallback) {
            copy[i] = new TextInputCallback(((TextInputCallback) original[i]).getPrompt());
            extCallbacks.add(copy[i]);
            if (debug.messageEnabled()) {
                debug.message("clone #" + i + " is TextInputCallback");
            }
        } else if (original[i] instanceof HttpCallback) {
            HttpCallback hc = (HttpCallback) original[i];
            copy[i] = new HttpCallback(hc.getAuthorizationHeader(), hc.getNegotiationHeaderName(), hc.getNegotiationHeaderValue(), hc.getNegotiationCode());
            extCallbacks.add(copy[i]);
        } else if (original[i] instanceof RedirectCallback) {
            RedirectCallback rc = (RedirectCallback) original[i];
            copy[i] = new RedirectCallback(rc.getRedirectUrl(), rc.getRedirectData(), rc.getMethod(), rc.getStatusParameter(), rc.getRedirectBackUrlCookieName());
            extCallbacks.add(copy[i]);
        } else {
            debug.error("unknown callback " + original[i]);
        }
    // more callbacks need to be handled here if ...
    }
    // construct external Callback[]
    Callback[] ext = new Callback[extCallbacks.size()];
    if (!extCallbacks.isEmpty()) {
        Iterator it = extCallbacks.iterator();
        int i = 0;
        while (it.hasNext()) {
            ext[i++] = (Callback) it.next();
        }
    }
    // set external/internal callbacks
    internal.set(index, copy);
    external.set(index, ext);
    return ext;
}
Also used : ConfirmationCallback(javax.security.auth.callback.ConfirmationCallback) HiddenValueCallback(com.sun.identity.authentication.callbacks.HiddenValueCallback) ArrayList(java.util.ArrayList) ScriptTextOutputCallback(com.sun.identity.authentication.callbacks.ScriptTextOutputCallback) ScriptTextOutputCallback(com.sun.identity.authentication.callbacks.ScriptTextOutputCallback) TextOutputCallback(javax.security.auth.callback.TextOutputCallback) SessionConstraint(com.iplanet.dpro.session.service.SessionConstraint) TextInputCallback(javax.security.auth.callback.TextInputCallback) ChoiceCallback(javax.security.auth.callback.ChoiceCallback) HiddenValueCallback(com.sun.identity.authentication.callbacks.HiddenValueCallback) ScriptTextOutputCallback(com.sun.identity.authentication.callbacks.ScriptTextOutputCallback) PasswordCallback(javax.security.auth.callback.PasswordCallback) Callback(javax.security.auth.callback.Callback) TextInputCallback(javax.security.auth.callback.TextInputCallback) TextOutputCallback(javax.security.auth.callback.TextOutputCallback) LoginStateCallback(com.sun.identity.authentication.service.LoginStateCallback) ChoiceCallback(javax.security.auth.callback.ChoiceCallback) NameCallback(javax.security.auth.callback.NameCallback) ConfirmationCallback(javax.security.auth.callback.ConfirmationCallback) NameCallback(javax.security.auth.callback.NameCallback) Iterator(java.util.Iterator) PasswordCallback(javax.security.auth.callback.PasswordCallback) List(java.util.List) ArrayList(java.util.ArrayList)

Example 4 with ScriptTextOutputCallback

use of com.sun.identity.authentication.callbacks.ScriptTextOutputCallback in project OpenAM by OpenRock.

the class AMModuleProperties method walk.

//walk the DOM tree and create the callback array
private void walk(Node node) {
    int type = node.getNodeType();
    String nodeName = node.getNodeName();
    debug.message("Callback type: " + nodeName);
    String tmp;
    Node sub;
    switch(type) {
        case Node.ELEMENT_NODE:
            {
                if (nodeName.equals("ModuleProperties")) {
                    moduleName = getAttribute(node, "moduleName");
                } else if (nodeName.equals("Callbacks")) {
                    p = 0;
                    String timeout = getAttribute(node, "timeout");
                    String template = getAttribute(node, "template");
                    if (template == null) {
                        template = "";
                    }
                    String image = getAttribute(node, "image");
                    if (image == null) {
                        image = "";
                    }
                    String header = getAttribute(node, "header");
                    boolean error = Boolean.valueOf(getAttribute(node, "error")).booleanValue();
                    int size = Integer.parseInt(getAttribute(node, "length")) + 1;
                    int t = 0;
                    if (timeout != null) {
                        t = Integer.parseInt(timeout);
                    }
                    order = getAttribute(node, "order");
                    callbacks = new Callback[size];
                    callbacks[p] = new PagePropertiesCallback(moduleName, header, image, t, template, error, order);
                    p++;
                    attribute = new ArrayList();
                    require = new ArrayList();
                    infoText = new ArrayList<String>();
                } else if (nodeName.equals("NameCallback")) {
                    sub = node.getFirstChild();
                    sub = sub.getNextSibling();
                    String prompt = sub.getFirstChild().getNodeValue();
                    String dftName = null;
                    sub = sub.getNextSibling().getNextSibling();
                    if (sub != null) {
                        sub = sub.getFirstChild();
                        dftName = sub.getNodeValue();
                        callbacks[p] = new NameCallback(prompt, dftName);
                    } else {
                        callbacks[p] = new NameCallback(prompt);
                    }
                    tmp = getAttribute(node, "isRequired");
                    if (tmp != null) {
                        if (tmp.equals("true")) {
                            require.add("true");
                        } else {
                            require.add("");
                        }
                    } else {
                        require.add("");
                    }
                    tmp = getAttribute(node, "attribute");
                    if (tmp != null) {
                        attribute.add(tmp);
                    } else {
                        attribute.add("");
                    }
                    tmp = getAttribute(node, "infoText");
                    if (tmp != null) {
                        infoText.add(tmp);
                    } else {
                        infoText.add("");
                    }
                    p++;
                } else if (nodeName.equals("HiddenValueCallback")) {
                    sub = node.getFirstChild();
                    sub = sub.getNextSibling();
                    String id = sub.getFirstChild().getNodeValue();
                    String dftName = null;
                    sub = sub.getNextSibling().getNextSibling();
                    if (sub != null) {
                        sub = sub.getFirstChild();
                        dftName = sub.getNodeValue();
                        callbacks[p] = new HiddenValueCallback(id, dftName);
                    } else {
                        callbacks[p] = new HiddenValueCallback(id);
                    }
                    tmp = getAttribute(node, "isRequired");
                    if (Boolean.parseBoolean(tmp)) {
                        require.add("true");
                    } else {
                        require.add("");
                    }
                    tmp = getAttribute(node, "attribute");
                    if (tmp != null) {
                        attribute.add(tmp);
                    } else {
                        attribute.add("");
                    }
                    tmp = getAttribute(node, "infoText");
                    if (tmp != null) {
                        infoText.add(tmp);
                    } else {
                        infoText.add("");
                    }
                    p++;
                } else if (nodeName.equals("PasswordCallback")) {
                    String echo = getAttribute(node, "echoPassword");
                    sub = node.getFirstChild();
                    sub = sub.getNextSibling().getFirstChild();
                    String prompt = sub.getNodeValue();
                    boolean b = Boolean.valueOf(echo).booleanValue();
                    callbacks[p] = new PasswordCallback(prompt, b);
                    tmp = getAttribute(node, "isRequired");
                    if (tmp != null) {
                        if (tmp.equals("true")) {
                            require.add("true");
                        } else {
                            require.add("");
                        }
                    } else {
                        require.add("");
                    }
                    tmp = getAttribute(node, "attribute");
                    if (tmp != null) {
                        attribute.add(tmp);
                    } else {
                        attribute.add("");
                    }
                    tmp = getAttribute(node, "infoText");
                    if (tmp != null) {
                        infoText.add(tmp);
                    } else {
                        infoText.add("");
                    }
                    p++;
                } else if (nodeName.equals("ChoiceCallback")) {
                    String multiple = getAttribute(node, "multipleSelectionsAllowed");
                    String prompt = null;
                    String[] choices = null;
                    int defaultChoice = 0;
                    boolean mch = Boolean.valueOf(multiple).booleanValue();
                    for (sub = node.getFirstChild(); sub != null; sub = sub.getNextSibling()) {
                        if (sub.getNodeName().equals("Prompt")) {
                            prompt = sub.getFirstChild().getNodeValue();
                        } else if (sub.getNodeName().equals("ChoiceValues")) {
                            int len = 0;
                            Node ss = sub.getFirstChild().getNextSibling();
                            for (Node count = ss; count != null; count = count.getNextSibling().getNextSibling()) {
                                len++;
                            }
                            choices = new String[len];
                            for (int i = 0; i < len; i++) {
                                choices[i] = ss.getFirstChild().getNextSibling().getFirstChild().getNodeValue();
                                if (Boolean.valueOf(getAttribute(ss, "isDefault")).booleanValue()) {
                                    defaultChoice = i;
                                }
                                ss = ss.getNextSibling().getNextSibling();
                            }
                            break;
                        }
                    }
                    callbacks[p] = new ChoiceCallback(prompt, choices, defaultChoice, mch);
                    tmp = getAttribute(node, "isRequired");
                    if (tmp != null) {
                        if (tmp.equals("true")) {
                            require.add("true");
                        } else {
                            require.add("");
                        }
                    } else {
                        require.add("");
                    }
                    tmp = getAttribute(node, "attribute");
                    if (tmp != null) {
                        attribute.add(tmp);
                    } else {
                        attribute.add("");
                    }
                    tmp = getAttribute(node, "infoText");
                    if (tmp != null) {
                        infoText.add(tmp);
                    } else {
                        infoText.add("");
                    }
                    p++;
                } else if (nodeName.equals("ConfirmationCallback")) {
                    int messageType = ConfirmationCallback.INFORMATION;
                    int defaultOption = 0;
                    String[] options = null;
                    for (sub = node.getFirstChild(); sub != null; sub = sub.getNextSibling()) {
                        if (sub.getNodeName().equals("OptionValues")) {
                            int len = 0;
                            Node ss = sub.getFirstChild().getNextSibling();
                            for (Node count = ss; count != null; count = count.getNextSibling().getNextSibling()) {
                                len++;
                            }
                            options = new String[len];
                            for (int i = 0; i < len; i++) {
                                options[i] = ss.getFirstChild().getNextSibling().getFirstChild().getNodeValue();
                                ss = ss.getNextSibling().getNextSibling();
                            }
                            break;
                        }
                    }
                    callbacks[p] = new ConfirmationCallback(messageType, options, defaultOption);
                    p++;
                } else if (nodeName.equals("TextInputCallback")) {
                    sub = node.getFirstChild();
                    sub = sub.getNextSibling().getFirstChild();
                    String prompt = sub.getNodeValue();
                    callbacks[p] = new TextInputCallback(prompt);
                    p++;
                } else if (nodeName.equals("TextOutputCallback")) {
                    int messageType = TextOutputCallback.ERROR;
                    String s = getAttribute(node, "messageType");
                    String value = node.getFirstChild().getNodeValue();
                    if (s.equals("script")) {
                        callbacks[p] = new ScriptTextOutputCallback(value);
                    } else {
                        if (s.equals("error")) {
                            messageType = TextOutputCallback.ERROR;
                        } else if (s.equals("warning")) {
                            messageType = TextOutputCallback.WARNING;
                        } else {
                            //default to information
                            messageType = TextOutputCallback.INFORMATION;
                        }
                        callbacks[p] = new TextOutputCallback(messageType, value);
                    }
                    p++;
                } else if (nodeName.equals("LanguageCallback")) {
                    for (sub = node.getFirstChild(); sub != null; sub = sub.getNextSibling()) {
                        if (sub.getNodeName().equals("ChoiceValue")) {
                            String isdefault = getAttribute(sub, "isDefault");
                        }
                    }
                    callbacks[p] = new LanguageCallback();
                    p++;
                } else if (nodeName.equals(AuthXMLTags.HTTP_CALLBACK)) {
                    String header = null;
                    String negotiation = null;
                    String code = null;
                    sub = node.getFirstChild();
                    for (; sub != null; sub = sub.getNextSibling()) {
                        String tmpStr = sub.getNodeName();
                        if (tmpStr.equals(AuthXMLTags.HTTP_HEADER)) {
                            header = sub.getFirstChild().getNodeValue();
                        } else if (tmpStr.equals(AuthXMLTags.HTTP_NEGO)) {
                            negotiation = sub.getFirstChild().getNodeValue();
                        } else if (tmpStr.equals(AuthXMLTags.HTTP_CODE)) {
                            code = sub.getFirstChild().getNodeValue();
                        }
                    }
                    callbacks[p] = new HttpCallback(header, negotiation, code);
                    p++;
                } else if (nodeName.equals(AuthXMLTags.REDIRECT_CALLBACK)) {
                    String redirectUrl = null;
                    String statusParameter = null;
                    String redirectBackUrlCookie = null;
                    Map redirectData = new HashMap();
                    String method = getAttribute(node, AuthXMLTags.REDIRECT_METHOD);
                    sub = node.getFirstChild();
                    for (; sub != null; sub = sub.getNextSibling()) {
                        String tmpStr = sub.getNodeName();
                        if (tmpStr.equals(AuthXMLTags.REDIRECT_URL)) {
                            redirectUrl = sub.getFirstChild().getNodeValue();
                        } else if (tmpStr.equals(AuthXMLTags.REDIRECT_STATUS_PARAM)) {
                            statusParameter = sub.getFirstChild().getNodeValue();
                        } else if (tmpStr.equals(AuthXMLTags.REDIRECT_BACK_URL_COOKIE)) {
                            redirectBackUrlCookie = sub.getFirstChild().getNodeValue();
                        } else if (tmpStr.equals(AuthXMLTags.REDIRECT_DATA)) {
                            String name = null;
                            String value = null;
                            Node ss = sub.getFirstChild().getNextSibling();
                            String tmpStrName = ss.getNodeName();
                            if (tmpStrName.equals("Name")) {
                                name = ss.getFirstChild().getNodeValue();
                            }
                            ss = ss.getNextSibling().getNextSibling();
                            String tmpStrValue = ss.getNodeName();
                            if (tmpStrValue.equals("Value")) {
                                value = ss.getFirstChild().getNodeValue();
                            }
                            redirectData.put(name, value);
                        }
                    }
                    if (debug.messageEnabled()) {
                        debug.message("redirectUrl : " + redirectUrl);
                        debug.message("statusParameter : " + statusParameter);
                        debug.message("redirectBackUrlCookie : " + redirectBackUrlCookie);
                        debug.message("redirectData : " + redirectData);
                        debug.message("method : " + method);
                    }
                    callbacks[p] = new RedirectCallback(redirectUrl, redirectData, method);
                    p++;
                }
                break;
            }
        //end of element
        default:
            break;
    }
    for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
        walk(child);
    }
    //without this the ending tags will miss
    if (type == Node.ELEMENT_NODE) {
        if (nodeName.equals("Callbacks")) {
            ((PagePropertiesCallback) callbacks[0]).setAttribute(attribute);
            ((PagePropertiesCallback) callbacks[0]).setRequire(require);
            ((PagePropertiesCallback) callbacks[0]).setInfoText(infoText);
            rtable.put(order, callbacks);
        //attrtable.put(order, subAttr);
        //requiretable.put(order, subRequire);
        }
    }
}
Also used : ConfirmationCallback(javax.security.auth.callback.ConfirmationCallback) HashMap(java.util.HashMap) HiddenValueCallback(com.sun.identity.authentication.callbacks.HiddenValueCallback) Node(org.w3c.dom.Node) ArrayList(java.util.ArrayList) ScriptTextOutputCallback(com.sun.identity.authentication.callbacks.ScriptTextOutputCallback) TextOutputCallback(javax.security.auth.callback.TextOutputCallback) ScriptTextOutputCallback(com.sun.identity.authentication.callbacks.ScriptTextOutputCallback) LanguageCallback(javax.security.auth.callback.LanguageCallback) TextInputCallback(javax.security.auth.callback.TextInputCallback) ChoiceCallback(javax.security.auth.callback.ChoiceCallback) NameCallback(javax.security.auth.callback.NameCallback) PasswordCallback(javax.security.auth.callback.PasswordCallback) HashMap(java.util.HashMap) Map(java.util.Map) NamedNodeMap(org.w3c.dom.NamedNodeMap)

Example 5 with ScriptTextOutputCallback

use of com.sun.identity.authentication.callbacks.ScriptTextOutputCallback in project OpenAM by OpenRock.

the class Scripted method createClientSideScriptAndSelfSubmitCallback.

private Callback createClientSideScriptAndSelfSubmitCallback() {
    String clientSideScriptExecutorFunction = ScriptedClientUtilityFunctions.createClientSideScriptExecutorFunction(getClientSideScript(), CLIENT_SCRIPT_OUTPUT_DATA_PARAMETER_NAME, getClientSideScriptEnabled());
    ScriptTextOutputCallback scriptAndSelfSubmitCallback = new ScriptTextOutputCallback(clientSideScriptExecutorFunction);
    return scriptAndSelfSubmitCallback;
}
Also used : ScriptTextOutputCallback(com.sun.identity.authentication.callbacks.ScriptTextOutputCallback)

Aggregations

ScriptTextOutputCallback (com.sun.identity.authentication.callbacks.ScriptTextOutputCallback)5 TextOutputCallback (javax.security.auth.callback.TextOutputCallback)3 HiddenValueCallback (com.sun.identity.authentication.callbacks.HiddenValueCallback)2 ArrayList (java.util.ArrayList)2 ChoiceCallback (javax.security.auth.callback.ChoiceCallback)2 ConfirmationCallback (javax.security.auth.callback.ConfirmationCallback)2 NameCallback (javax.security.auth.callback.NameCallback)2 PasswordCallback (javax.security.auth.callback.PasswordCallback)2 TextInputCallback (javax.security.auth.callback.TextInputCallback)2 SessionConstraint (com.iplanet.dpro.session.service.SessionConstraint)1 LoginStateCallback (com.sun.identity.authentication.service.LoginStateCallback)1 AuthLoginException (com.sun.identity.authentication.spi.AuthLoginException)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1 Callback (javax.security.auth.callback.Callback)1 LanguageCallback (javax.security.auth.callback.LanguageCallback)1 NamedNodeMap (org.w3c.dom.NamedNodeMap)1