Code example for Subject

Methods: getPrivateCredentialsgetPublicCredentials

    public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options) {
        if (options.containsKey("username")) {
            // Zookeeper client: get username and password from JAAS conf (only used if using DIGEST-MD5). 
            this.subject = subject;
            String username = (String)options.get("username");
            String password = (String)options.get("password");
    public boolean logout() { 
        return true; 
    public boolean login() { 
        // Unlike with Krb5LoginModule, we don't do any actual login or credential passing here: authentication to Zookeeper 
        // is done later, through the SASLClient object. 
        return true; 
Connect your IDE to all the code out there  Get Codota for Java