@5minds/node-red-contrib-processcube 1.5.2-feature-95789a-m3625uau → 1.5.2-feature-bdcb95-m362ojnw

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.5.2-feature-95789a-m3625uau",
3
+ "version": "1.5.2-feature-bdcb95-m362ojnw",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {
@@ -41,8 +41,13 @@ module.exports = function (RED) {
41
41
  if (
42
42
  !RED.util.evaluateNodeProperty(n.clientId, n.clientIdType, node) ||
43
43
  !RED.util.evaluateNodeProperty(n.clientSecret, n.clientSecretType, node)
44
- )
44
+ ) {
45
45
  return null;
46
+ }
47
+
48
+ node.log(RED.util.evaluateNodeProperty(n.clientId, n.clientIdType, node));
49
+ node.log(RED.util.evaluateNodeProperty(n.clientSecret, n.clientSecretType, node));
50
+
46
51
  const res = await fetch(url + '/atlas_engine/api/v1/authority', {
47
52
  method: 'GET',
48
53
  headers: {
@@ -53,16 +58,22 @@ module.exports = function (RED) {
53
58
 
54
59
  const issuer = await oidc.Issuer.discover(await res.json());
55
60
 
61
+ node.log('after issuer');
62
+
56
63
  const client = new issuer.Client({
57
64
  client_id: RED.util.evaluateNodeProperty(n.clientId, n.clientIdType, node),
58
65
  client_secret: RED.util.evaluateNodeProperty(n.clientSecret, n.clientSecretType, node),
59
66
  });
60
67
 
68
+ node.log('after client');
69
+
61
70
  const tokenSet = await client.grant({
62
71
  grant_type: 'client_credentials',
63
72
  scope: 'engine_etw engine_read engine_write',
64
73
  });
65
74
 
75
+ node.log('after grant');
76
+
66
77
  const accessToken = tokenSet.access_token;
67
78
  const decodedToken = jwt.jwtDecode(accessToken);
68
79