コード例 #1
0
ファイル: connection.py プロジェクト: marijamarkovic/naali
 def resendAuthorization(self, AuthError):
     print ''
     print '---------------------------------------------------------'
     print 'AuthorizationError was raised, trying to resend auth data'
     print '---------------------------------------------------------'
     if AuthError.authType == "Basic":
         self.resource.connection.addBasicAuthorization(
             self.user, str(self.password))
     elif AuthError.authType == "Digest":
         info = WebdavClient.parseDigestAuthInfo(AuthError.authInfo)
         self.resource.connection.addDigestAuthorization(
             self.user,
             self.password,
             realm=info["realm"],
             qop=info["qop"],
             nonce=info["nonce"])
     else:
         raise WebdavError
     try:
         self.resource.getCollectionContents()
         print "----------- RE-AUTHENTICATION SUCCESFULL ------------\n"
     except AuthorizationError as e:
         print "-------- TRIED TO RE-AUTHENTICATE BUT FAILED --------\n"
         print "Please restart your viewer and reconnect to fix,"
         print "webdav inventory is in early dev state and "
         print "reauthentication is not fully working."
コード例 #2
0
ファイル: connection.py プロジェクト: marijamarkovic/naali
 def determineAuthentication(self):
     authFailures = 0
     while authFailures < 2:
         try:
             self.resource.getCollectionContents()
         except AuthorizationError as e:
             if e.authType == "Basic":
                 #self.password = QInputDialog.getText(None, "WebDav Inventory Password", "WebDav Inventory is asking for Basic authentication\n\nPlease give your password:"******"")
                 #self.password = "" # CableBeach server does not check passwords yet
                 self.resource.connection.addBasicAuthorization(
                     self.user, str(self.password))
             elif e.authType == "Digest":
                 #self.password = QInputDialog.getText(None, "WebDav Inventory Password", "WebDav Inventory is asking for Digest authentication\n\nPlease give your password:"******"")
                 #self.password = "" # CableBeach server does not check passwords yet
                 info = WebdavClient.parseDigestAuthInfo(e.authInfo)
                 self.resource.connection.addDigestAuthorization(
                     self.user,
                     self.password,
                     realm=info["realm"],
                     qop=info["qop"],
                     nonce=info["nonce"])
             else:
                 raise WebdavError
         except HTTPException:
             raise HTTPException
         authFailures += 1
コード例 #3
0
ファイル: connection.py プロジェクト: caocao/naali
 def determineAuthentication(self):       
     authFailures = 0
     while authFailures < 2:
         try:
             self.resource.getCollectionContents()
         except AuthorizationError as e:                           
             if e.authType == "Basic":
                 #self.password = QInputDialog.getText(None, "WebDav Inventory Password", "WebDav Inventory is asking for Basic authentication\n\nPlease give your password:"******"")
                 self.password = "" # CableBeach server does not check passwords yet
                 self.resource.connection.addBasicAuthorization(self.user, str(self.password))
             elif e.authType == "Digest":
                 #self.password = QInputDialog.getText(None, "WebDav Inventory Password", "WebDav Inventory is asking for Digest authentication\n\nPlease give your password:"******"")
                 self.password = "" # CableBeach server does not check passwords yet
                 info = WebdavClient.parseDigestAuthInfo(e.authInfo)
                 self.resource.connection.addDigestAuthorization(self.user, self.password, realm=info["realm"], qop=info["qop"], nonce=info["nonce"])
             else:
                 raise WebdavError
         except HTTPException:
             raise HTTPException
         authFailures += 1
コード例 #4
0
ファイル: connection.py プロジェクト: caocao/naali
 def resendAuthorization(self, AuthError):
     print ''
     print '---------------------------------------------------------'
     print 'AuthorizationError was raised, trying to resend auth data'
     print '---------------------------------------------------------'
     if AuthError.authType == "Basic":
         self.resource.connection.addBasicAuthorization(self.user, str(self.password))
     elif AuthError.authType == "Digest":
         info = WebdavClient.parseDigestAuthInfo(AuthError.authInfo)
         self.resource.connection.addDigestAuthorization(self.user, self.password, realm=info["realm"], qop=info["qop"], nonce=info["nonce"])
     else:
         raise WebdavError
     try:
         self.resource.getCollectionContents()
         print "----------- RE-AUTHENTICATION SUCCESFULL ------------\n"
     except AuthorizationError as e:
         print "-------- TRIED TO RE-AUTHENTICATE BUT FAILED --------\n"
         print "Please restart your viewer and reconnect to fix,"
         print "webdav inventory is in early dev state and "
         print "reauthentication is not fully working."