@Override
    public void init(Attributes attributes) throws SAXException {

        // Init username and password
        authorization.setUsername(attributes.getValue("username"));
        authorization.setPassword(attributes.getValue("password"));

        // Get encoding
        String encoding = attributes.getValue("encoding");
        if (encoding != null) {

            // If "md5", use MD5 encoding
            if (encoding.equals("md5"))
                authorization.setEncoding(Authorization.Encoding.MD5);

            // If "sha256" use SHA-256 hash
            else if (encoding.equals("sha256"))
                authorization.setEncoding(Authorization.Encoding.SHA_256);

            // If "plain", use plain text
            else if (encoding.equals("plain"))
                authorization.setEncoding(Authorization.Encoding.PLAIN_TEXT);

            // Otherwise, bad encoding
            else
                throw new SAXException(
                        "Invalid encoding: '" + encoding + "'");

        }

        parent.addAuthorization(this.asAuthorization());

    }
Creates a new AuthorizeTagHandler that parses an Authorization owned
by the given UserMapping.

@param parent The UserMapping that owns the Authorization this handler
              will parse.
guacamole/src/main/java/org/apache/guacamole/auth/file/AuthorizeTagHandler.java