New domain preference: SOGoIMAPCASServiceName
Set this to the service name expected by the CAS server if it differs from SOGoIMAPServer. This is useful to request a CAS ticket for service imap://imap.domain.com while connecting through imapproxy on imap://127.0.0.1:1143 SOGoDAVAuthenticator is not updated since it doesn't really use the imap code.pull/12/head
parent
f24e3a0a31
commit
0fb006c19f
|
@ -43,6 +43,7 @@
|
|||
- (NSString *) mailDomain;
|
||||
- (NSString *) imapServer;
|
||||
- (NSString *) sieveServer;
|
||||
- (NSString *) imapCASServiceName;
|
||||
- (NSString *) imapAclStyle;
|
||||
- (NSString *) imapAclGroupIdPrefix;
|
||||
- (NSString *) imapFolderSeparator;
|
||||
|
|
|
@ -123,6 +123,11 @@
|
|||
return [self stringForKey: @"SOGoSieveServer"];
|
||||
}
|
||||
|
||||
- (NSString *) imapCASServiceName
|
||||
{
|
||||
return [self objectForKey: @"SOGoIMAPCASServiceName"];
|
||||
}
|
||||
|
||||
#warning should be removed when we make use of imap namespace
|
||||
- (NSString *) imapAclStyle
|
||||
{
|
||||
|
|
|
@ -269,12 +269,13 @@
|
|||
forceRenew: (BOOL) renew
|
||||
{
|
||||
NSString *authType, *password;
|
||||
SOGoSystemDefaults *sd;
|
||||
|
||||
password = [self passwordInContext: context];
|
||||
if ([password length])
|
||||
{
|
||||
authType = [[SOGoSystemDefaults sharedSystemDefaults]
|
||||
authenticationType];
|
||||
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||
authType = [sd authenticationType];
|
||||
if ([authType isEqualToString: @"cas"])
|
||||
{
|
||||
SOGoCASSession *session;
|
||||
|
@ -283,13 +284,18 @@
|
|||
session = [SOGoCASSession CASSessionWithIdentifier: password
|
||||
fromProxy: NO];
|
||||
|
||||
service = [sd imapCASServiceName]; // try configured service first
|
||||
if (!service)
|
||||
{
|
||||
// We must NOT assume the scheme exists
|
||||
scheme = [server scheme];
|
||||
|
||||
if (!scheme)
|
||||
scheme = @"imap";
|
||||
|
||||
service = [NSString stringWithFormat: @"%@://%@", scheme, [server host]];
|
||||
service = [NSString stringWithFormat: @"%@://%@",
|
||||
scheme, [server host]];
|
||||
}
|
||||
|
||||
if (renew)
|
||||
[session invalidateTicketForService: service];
|
||||
|
|
Loading…
Reference in New Issue