Code example for Subject

Methods: getPrincipals, getPrivateCredentials

0
         
        return true; 
    } 
 
    public boolean commit() throws LoginException { 
        subject.getPrincipals().add(client);
        subject.getPrivateCredentials().add(krbTicket);
        return true; 
    } 
 
    public void initialize(Subject subject, CallbackHandler callbackHandler,
            Map<String, ?> sharedState, Map<String, ?> options) {
        // TODO 
        this.subject = subject;
        this.options = options;
        this.callbackHandler = callbackHandler;
    } 
 
    public boolean login() throws LoginException { 
 
        String name = (String) options.get(PRINCIPAL);