Skip to content

Commit 680166c

Browse files
committed
Add support for id token
1 parent 4189c03 commit 680166c

6 files changed

Lines changed: 20 additions & 6 deletions

File tree

OpenFlow/src/Messages/Message.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,20 @@ export class Message {
12561256
AccessToken = await OAuthProvider.instance.oidc.AccessToken.find(msg.rawAssertion);
12571257
if (!NoderedUtil.IsNullUndefinded(AccessToken)) {
12581258
User = await OAuthProvider.instance.oidc.Account.findAccount(null, AccessToken.accountId);
1259+
} else {
1260+
var c = OAuthProvider.instance.clients;
1261+
for (var i = 0; i < OAuthProvider.instance.clients.length; i++) {
1262+
try {
1263+
var _cli = await OAuthProvider.instance.oidc.Client.find(OAuthProvider.instance.clients[i].clientId);;
1264+
AccessToken = await OAuthProvider.instance.oidc.IdToken.validate(msg.rawAssertion, _cli);
1265+
if (!NoderedUtil.IsNullEmpty(AccessToken)) {
1266+
User = await OAuthProvider.instance.oidc.Account.findAccount(null, AccessToken.payload.sub);
1267+
break;
1268+
}
1269+
} catch (error) {
1270+
1271+
}
1272+
}
12591273
}
12601274
} catch (error) {
12611275
console.error(error);

OpenFlow/src/OAuthProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Response = OAuthServer.Response;
1313
export class OAuthProvider {
1414
private app: express.Express;
1515
public static instance: OAuthProvider = null;
16-
private clients = [];
16+
public clients = [];
1717
private codes = {};
1818
public oauthServer: any = null;
1919
private authorizationCodeStore: any = {};

OpenFlow/src/public/Controllers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,8 +1398,8 @@ export class RPAWorkflowsCtrl extends entitiesCtrl<Base> {
13981398
}
13991399
download(data, filename, type) {
14001400
const file = new Blob([data], { type: type });
1401-
if (window.navigator.msSaveOrOpenBlob) // IE10+
1402-
window.navigator.msSaveOrOpenBlob(file, filename);
1401+
if ((window.navigator as any).msSaveOrOpenBlob) // IE10+
1402+
(window.navigator as any).msSaveOrOpenBlob(file, filename);
14031403
else { // Others
14041404
const a = document.createElement("a"),
14051405
url = URL.createObjectURL(file);

OpenFlowNodeRED/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/nodered",
3-
"version": "1.3.73",
3+
"version": "1.3.75",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.73
1+
1.3.75

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/openflow",
3-
"version": "1.3.73",
3+
"version": "1.3.75",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)