-
Notifications
You must be signed in to change notification settings - Fork 1
/
cognito-auth.html
92 lines (80 loc) · 3.29 KB
/
cognito-auth.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<script type="text/javascript">
RED.nodes.registerType('cognito-auth',{
category: 'function',
color: '#a6bbcf',
defaults: {
name: {value:""},
target: {value:"payload"},
userpoolid: {value:""},
userpoolidType: {value:"str"},
clientid: {value:""},
clientidType: {value:"str"},
tokentype: {value: "access"},
tokentypeType: {value: "str"}
},
credentials: {
username: {type:"text"},
password: {type:"password"}
},
inputs:1,
outputs:1,
icon: "font-awesome/user-circle-o",
label: function() {
return this.name||"cognito-auth";
},
oneditprepare: function() {
$("#node-input-userpoolid").typedInput({
type:"str",
types:["str","msg", "flow","global"],
typeField: "#node-input-userpoolidType"
});
$("#node-input-clientid").typedInput({
type:"str",
types:["str","msg", "flow","global"],
typeField: "#node-input-clientidType"
});
$("#node-input-tokentype").typedInput({
type:"str",
types:["str","msg", "flow","global"],
typeField: "#node-input-tokentypeType"
})
}
});
</script>
<script type="text/html" data-template-name="cognito-auth">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-target"><i class="fa fa-tag"></i>Target attribute</label>
<input type="text" id="node-input-target" placeholder="msg Attribute">
</div>
<div class="form-row">
<label for="node-input-username"><i class="fa fa-tag"></i> Username</label>
<input type="text" id="node-input-username" placeholder="Cognito User Name">
</div>
<div class="form-row">
<label for="node-input-password"><i class="fa fa-tag"></i> Password</label>
<input type="password" id="node-input-password" placeholder="Cognito User Password">
</div>
<div class="form-row">
<label for="node-input-userpoolid"><i class="fa fa-tag"></i>Userpool Id</label>
<input type="text" id="node-input-userpoolid" placeholder="Cognito userpoolid">
<input type="hidden" id="node-input-userpoolidType">
</div>
<div class="form-row">
<label for="node-input-clientid"><i class="fa fa-tag"></i>Client Id</label>
<input type="text" id="node-input-clientid" placeholder="Cognito clientid">
<input type="hidden" id="node-input-clientidType">
</div>
<div class="form-row">
<label for="node-input-tokentype"><i class="fa fa-tag"></i>Token Type</label>
<input type="text" id="node-input-tokentype" placeholder="Cognito tokentype">
<input type="hidden" id="node-input-tokentypeType">
</div>
</script>
<script type="text/html" data-help-name="cognito-auth">
<p> A simple node that authenticates against AWS cognito and always returns a valid JWT.<br/>
Tokens that are still valid will be kept.</p>
</script>