itest/spring/src/main/java/calculator/security/JaasLoginModule.java [54:76]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public boolean login() throws LoginException {
        Callback[] callbacks = new Callback[2];
        callbacks[0] = new NameCallback("UserId:");
        callbacks[1] = new PasswordCallback("Password:", false);

        try {
            callbackHandler.handle(callbacks);
            userId = ((NameCallback)callbacks[0]).getName();
            password = new String(((PasswordCallback)callbacks[1]).getPassword());

            if (userId.equals("CalculatorUser") && password.equals("CalculatorUserPasswd")) {
                System.out.println("Successfully AUTHENTICATED!!");
                succeeded = true;
                return true;
            } else {
                System.out.println("Incorrect userId / password! AUTHENTICATION FAILED!!");
                return false;
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/JaasLoginModule.java [55:77]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public boolean login() throws LoginException {
        Callback[] callbacks = new Callback[2];
        callbacks[0] = new NameCallback("UserId:");
        callbacks[1] = new PasswordCallback("Password:", false);

        try {
            callbackHandler.handle(callbacks);
            userId = ((NameCallback)callbacks[0]).getName();
            password = new String(((PasswordCallback)callbacks[1]).getPassword());

            if (userId.equals("CalculatorUser") && password.equals("CalculatorUserPasswd")) {
                System.out.println("Successfully AUTHENTICATED!!");
                succeeded = true;
                return true;
            } else {
                System.out.println("Incorrect userId / password! AUTHENTICATION FAILED!!");
                return false;
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



