Bug 1163347 - Don't require scope in ispdb config for OAuth2, r=Fallen
This commit is contained in:
Родитель
eddeb6ebd1
Коммит
34ace30678
|
@ -54,16 +54,6 @@ function readFromXML(clientConfigXML)
|
|||
throw exception ? exception : "need proper <domain> in XML";
|
||||
exception = null;
|
||||
|
||||
let oauthSettings = null;
|
||||
if ("oauth2Settings" in clientConfigXML.clientConfig) {
|
||||
oauthSettings = {};
|
||||
oauthSettings.scope = sanitize.nonemptystring(
|
||||
clientConfigXML.clientConfig.oauth2Settings.scope);
|
||||
if (!oauthSettings.scope)
|
||||
throw new Error("Malformed oauth2Settings in configuration XML");
|
||||
d.oauthSettings = oauthSettings;
|
||||
}
|
||||
|
||||
// incoming server
|
||||
for (let iX of array_or_undef(xml.$incomingServer)) // input (XML)
|
||||
{
|
||||
|
@ -106,11 +96,6 @@ function readFromXML(clientConfigXML)
|
|||
"GSSAPI" : Ci.nsMsgAuthMethod.GSSAPI,
|
||||
"NTLM" : Ci.nsMsgAuthMethod.NTLM,
|
||||
"OAuth2" : Ci.nsMsgAuthMethod.OAuth2 });
|
||||
|
||||
// If we're using OAuth2, but don't have working settings, bail.
|
||||
if (iO.auth == Ci.nsMsgAuthMethod.OAuth2 && !oauthSettings)
|
||||
continue;
|
||||
|
||||
break; // take first that we support
|
||||
} catch (e) { exception = e; }
|
||||
}
|
||||
|
@ -194,10 +179,6 @@ function readFromXML(clientConfigXML)
|
|||
"OAuth2" : Ci.nsMsgAuthMethod.OAuth2,
|
||||
});
|
||||
|
||||
// If we're using OAuth2, but don't have working settings, bail.
|
||||
if (oO.auth == Ci.nsMsgAuthMethod.OAuth2 && !oauthSettings)
|
||||
continue;
|
||||
|
||||
break; // take first that we support
|
||||
} catch (e) { exception = e; }
|
||||
}
|
||||
|
|
|
@ -78,6 +78,8 @@ function verifyConfig(config, alter, msgWindow, successCallback, errorCallback)
|
|||
// Lookup issuer if needed.
|
||||
if (config.incoming.auth == Ci.nsMsgAuthMethod.OAuth2 ||
|
||||
config.outgoing.auth == Ci.nsMsgAuthMethod.OAuth2) {
|
||||
if (!config.oauthSettings)
|
||||
config.oauthSettings = {};
|
||||
if (!config.oauthSettings.issuer || !config.oauthSettings.scope) {
|
||||
// lookup issuer or scope from hostname
|
||||
let hostname = (config.incoming.auth == Ci.nsMsgAuthMethod.OAuth2) ?
|
||||
|
|
Загрузка…
Ссылка в новой задаче