mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
SASL Format
Added checkbox to turn off SASL formatting if the user wants to do this themselves
This commit is contained in:
parent
923ad0d361
commit
165e8013a7
@ -157,6 +157,10 @@
|
|||||||
<label for="node-input-password"><i class="fa fa-lock"></i> <span data-i18n="email.label.password"></span></label>
|
<label for="node-input-password"><i class="fa fa-lock"></i> <span data-i18n="email.label.password"></span></label>
|
||||||
<input type="password" id="node-input-password">
|
<input type="password" id="node-input-password">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-row node-input-saslformat" style="display: none;">
|
||||||
|
<label for="node-input-saslformat"><i class="fa fa-code"></i> <span data-i18n="email.label.saslformat"></span></label>
|
||||||
|
<input type="checkbox" id="node-input-saslformat" style="width: auto;">
|
||||||
|
</div>
|
||||||
<div class="form-row node-input-token" style="display: none;">
|
<div class="form-row node-input-token" style="display: none;">
|
||||||
<label for="node-input-token"><i class="fa fa-lock"></i> <span data-i18n="email.label.token"></span></label>
|
<label for="node-input-token"><i class="fa fa-lock"></i> <span data-i18n="email.label.token"></span></label>
|
||||||
<input type="text" id="node-input-token" placeholder="oauth2Response.access_token">
|
<input type="text" id="node-input-token" placeholder="oauth2Response.access_token">
|
||||||
@ -238,9 +242,11 @@
|
|||||||
var protocol = $("#node-input-authtype").val();
|
var protocol = $("#node-input-authtype").val();
|
||||||
if (protocol === "BASIC") {
|
if (protocol === "BASIC") {
|
||||||
$(".node-input-password").show();
|
$(".node-input-password").show();
|
||||||
|
$(".node-input-saslformat").hide();
|
||||||
$(".node-input-token").hide();
|
$(".node-input-token").hide();
|
||||||
} else {
|
} else {
|
||||||
$(".node-input-password").hide();
|
$(".node-input-password").hide();
|
||||||
|
$(".node-input-saslformat").show();
|
||||||
$(".node-input-token").show();
|
$(".node-input-token").show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -260,6 +266,7 @@
|
|||||||
autotls: {value: "never"},
|
autotls: {value: "never"},
|
||||||
port: {value:"993",required:true},
|
port: {value:"993",required:true},
|
||||||
authtype: {value: "BASIC"},
|
authtype: {value: "BASIC"},
|
||||||
|
saslformat: {value: true},
|
||||||
token: {value: "oauth2Response.access_token"},
|
token: {value: "oauth2Response.access_token"},
|
||||||
box: {value:"INBOX"}, // For IMAP, The mailbox to process
|
box: {value:"INBOX"}, // For IMAP, The mailbox to process
|
||||||
disposition: { value: "Read" }, // For IMAP, the disposition of the read email
|
disposition: { value: "Read" }, // For IMAP, the disposition of the read email
|
||||||
|
@ -196,6 +196,7 @@ module.exports = function(RED) {
|
|||||||
this.inport = n.port || (globalkeys && globalkeys.port) || "993";
|
this.inport = n.port || (globalkeys && globalkeys.port) || "993";
|
||||||
this.box = n.box || "INBOX";
|
this.box = n.box || "INBOX";
|
||||||
this.useSSL= n.useSSL;
|
this.useSSL= n.useSSL;
|
||||||
|
this.saslformat = n.saslformat;
|
||||||
this.autotls= n.autotls;
|
this.autotls= n.autotls;
|
||||||
this.token = n.token || "oAuth2Response.access_token";
|
this.token = n.token || "oAuth2Response.access_token";
|
||||||
this.protocol = n.protocol || "IMAP";
|
this.protocol = n.protocol || "IMAP";
|
||||||
@ -374,8 +375,12 @@ module.exports = function(RED) {
|
|||||||
if(node.authtype == "XOAUTH2") {
|
if(node.authtype == "XOAUTH2") {
|
||||||
var value = RED.util.getMessageProperty(msg,node.token);
|
var value = RED.util.getMessageProperty(msg,node.token);
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
//Make base64 string for access - compatible with outlook365 and gmail
|
if(node.saslformat) {
|
||||||
saslxoauth2 = Buffer.from("user="+node.userid+"\x01auth=Bearer "+value+"\x01\x01").toString('base64');
|
//Make base64 string for access - compatible with outlook365 and gmail
|
||||||
|
saslxoauth2 = Buffer.from("user="+node.userid+"\x01auth=Bearer "+value+"\x01\x01").toString('base64');
|
||||||
|
} else {
|
||||||
|
saslxoauth2 = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
imap = new Imap({
|
imap = new Imap({
|
||||||
xoauth2: saslxoauth2,
|
xoauth2: saslxoauth2,
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
"unseen": "Unseen",
|
"unseen": "Unseen",
|
||||||
"autotls": "Start TLS?",
|
"autotls": "Start TLS?",
|
||||||
"authtype": "Auth type",
|
"authtype": "Auth type",
|
||||||
|
"saslformat": "Format to SASL",
|
||||||
"token": "Token",
|
"token": "Token",
|
||||||
"never": "never",
|
"never": "never",
|
||||||
"required": "if required",
|
"required": "if required",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user