public Subject[] getClients()
        {

            // vvv http://stackoverflow.com/questions/197059/convert-dictionary-values-into-array

            Subject[] answer = new Subject[_clients.Count];
            _clients.Values.CopyTo(answer, 0);

            // ^^^ http://stackoverflow.com/questions/197059/convert-dictionary-values-into-array

            return answer;
        }
        ////////////////////////////////////////////////////////////////////////////
        // ClientSecurityConfiguration

        ////////////////////////////////////////////////////////////////////////////
        // ServerSecurityConfiguration::create

        public void addServer(Subject server)
        {
            String subjectIdentifier = server.Realm;
            String subjectPassword = server.Password;
            String subjectLabel = server.Label;

            this.addSubject(subjectIdentifier, subjectPassword, subjectLabel);
        }
        ////////////////////////////////////////////////////////////////////////////	
        // ServerSecurityConfiguration


        ////////////////////////////////////////////////////////////////////////////	
        // ServerSecurityConfiguration::create

        public void addClient(Subject client)
        {
            String subjectIdentifier = client.Username;
            String subjectPassword = client.Password;
            String subjectLabel = client.Label;

            this.addSubject(subjectIdentifier, subjectPassword, subjectLabel);

        }
        private void addSubject(String subjectIdentifier, String subjectPassword, String subjectLabel)
        {

            Subject client = new Subject(subjectIdentifier, _identifier, subjectPassword, subjectLabel);
            _clients[subjectIdentifier] = client;

            Subject server = new Subject(_identifier, subjectIdentifier, subjectPassword, subjectLabel);
            _servers[subjectIdentifier] = server;

            this.save();

        }
예제 #5
0
        public void addSubject(Subject subject)
        {
            String username = subject.Username;

            _subjectDictionary[username] = subject;
        }
        public bool subjectHasAuthenticatedSession(Subject target)
        {
            foreach (String opaque in _authenticatedSessions.Keys)
            {
                HttpSecuritySession authenticatedSession = _authenticatedSessions[opaque];
                Subject candidate = authenticatedSession.registeredSubject;

                if (candidate.Username.Equals(target.Username))
                {
                    return true;
                }
            }

            return false;

        }
 public void addRegisteredSubject(Subject registeredSubject)
 {
     log.enteredMethod();
     _securityConfiguration.addClient(registeredSubject);
 }
 public void addUnregisteredSubject(Subject unregisteredSubject)
 {
     log.enteredMethod();
     _unregisteredSubjects.addSubject(unregisteredSubject);
 }