gère correctement les remote-sso quand le serveur distant est down

This commit is contained in:
fpeters 2004-01-24 00:30:47 +00:00
parent a0dc8beb4d
commit 8be18b4a9b
1 changed files with 19 additions and 11 deletions

View File

@ -1105,22 +1105,30 @@ class Application(applications.Application):
if remaining[0] != 'remote-sso':
return None
dispatcherHostName = remaining[1]
user = context.getVar('user')
try:
identitiesProxy = getProxyForServerRole('identities')
if user:
identification = user.identityIdentifications[0]
token = identitiesProxy.checkIdentityLocalNameIdentifierIDP(
context.getVar('httpHostName'),
identification.peerNameIdentifier,
serverId = 'glasnost://%s' % dispatcherHostName)
context.setVar('localUserToken', context.getVar('userToken'))
context.setVar('userToken', token)
else:
# testing other end
identitiesProxy.isAdmin(
serverId = 'glasnost://%s' % dispatcherHostName)
except (faults.UnknownServerId, faults.UnknownDispatcherInId):
return None
context.setVar('dispatcherId',
'glasnost://%s' % dispatcherHostName)
context.setVar('remoteSso', 1)
remaining = remaining[2:]
user = context.getVar('user')
if user:
identitiesProxy = getProxyForServerRole('identities')
identification = user.identityIdentifications[0]
token = identitiesProxy.checkIdentityLocalNameIdentifierIDP(
context.getVar('httpHostName'),
identification.peerNameIdentifier,
serverId = 'glasnost://%s' % dispatcherHostName)
context.setVar('localUserToken', context.getVar('userToken'))
context.setVar('userToken', token)
result = self.parseHttpPathHelp(remaining)
if result is not None:
return result