From 6230a4840b448801632708d315fe8ac3aea81020 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:51:19 -0600 Subject: [PATCH 01/38] fix: delete org.gluu.agama.typekey.flow --- code/org.gluu.agama.typekey.flow | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 code/org.gluu.agama.typekey.flow diff --git a/code/org.gluu.agama.typekey.flow b/code/org.gluu.agama.typekey.flow deleted file mode 100644 index 30e3e60..0000000 --- a/code/org.gluu.agama.typekey.flow +++ /dev/null @@ -1,21 +0,0 @@ -Flow org.gluu.agama.typekey - Basepath "" - Configs conf -Log "@info " Starting Typekey Authentication -user = {} -password = {} -typekey = {} -user = RRF "typekey/username.ftlh" user -idp = Call org.gluu.agama.typekey.IdentityProcessor#new -userData = Call idp accountFromUsername user.username -When userData.empty is true - it_mqfld = {success:false, error: "Account not found"} - Finish it_mqfld -tk = Call org.gluu.agama.typekey.Typekey#new conf -enrolled = Call idp enrolled user.username -When enrolled is false - random_usecase = Call tk getRandomUseCase - phrase_map = Call tk getPhraseMap random_usecase - res = Call idp enroll user.username phrase_map -it_dhkcc = {success:true, data: { userId: user.username}} -Finish it_dhkcc \ No newline at end of file From eff7c12abeb1350583dc22d4dd3100828ff49f4b Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:51:19 -0600 Subject: [PATCH 02/38] fix: delete org.gluu.agama.typekey.json --- code/org.gluu.agama.typekey.json | 947 ------------------------------- 1 file changed, 947 deletions(-) delete mode 100644 code/org.gluu.agama.typekey.json diff --git a/code/org.gluu.agama.typekey.json b/code/org.gluu.agama.typekey.json deleted file mode 100644 index 0ad8d9d..0000000 --- a/code/org.gluu.agama.typekey.json +++ /dev/null @@ -1,947 +0,0 @@ -{ - "nodes": [ - { - "width": 170, - "height": 123, - "id": "finish-b23ed1c4-6a3f-45af-b6bf-159bae1ea4a0", - "position": { - "x": 2130, - "y": 29 - }, - "type": "finish", - "data": { - "id": "finish-b23ed1c4-6a3f-45af-b6bf-159bae1ea4a0", - "type": "Agama-finish-Flow", - "parentId": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e", - "whenCondition": "WhenFalse", - "inRepeatBlock": false, - "handles": [ - "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e.FAILURE", - "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e.SUCCESS" - ], - "position": { - "x": 2130, - "y": 29 - }, - "agamaData": { - "id": "finish-b23ed1c4-6a3f-45af-b6bf-159bae1ea4a0", - "parentId": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e", - "type": "Agama-finish-Flow", - "hasSuccess": false, - "hasFailure": false, - "hasComment": true, - "comment": "", - "flowfilename": "", - "returnVariable": "{ userId: user.username}", - "finishMode": "withSuccess", - "nodeIcon": "material-symbols:line-end-square-rounded" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 2130, - "y": 29 - } - }, - { - "width": 170, - "height": 123, - "id": "Agama-call-Node-0117bbe2-bcbf-4405-ae96-0b688a5487fc", - "position": { - "x": 2401, - "y": 312 - }, - "type": "call", - "data": { - "id": "Agama-call-Node-0117bbe2-bcbf-4405-ae96-0b688a5487fc", - "type": "Agama-call-Node", - "parentId": "Agama-call-Node-79fe19f6-c785-4427-a44e-84a764cdce7b", - "whenCondition": "", - "inRepeatBlock": false, - "position": { - "x": 2401, - "y": 312 - }, - "agamaData": { - "id": "Agama-call-Node-0117bbe2-bcbf-4405-ae96-0b688a5487fc", - "parentId": "Agama-call-Node-79fe19f6-c785-4427-a44e-84a764cdce7b", - "type": "Agama-call-Node", - "displayName": "Enroll phrase", - "hasComment": true, - "comment": "", - "javaClassName": "", - "javaMethodName": "enroll", - "javaVariableName": "idp", - "exceptionVariableField": "", - "callType": "Call method on instance", - "whenCondition": "", - "inRepeatBlock": false, - "arguments": [ - "user.username", - "phrase_map" - ], - "nodeIcon": "material-symbols:code", - "asssignedVariableName": "res" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 2401, - "y": 312 - } - }, - { - "width": 170, - "height": 123, - "id": "Agama-call-Node-79fe19f6-c785-4427-a44e-84a764cdce7b", - "position": { - "x": 2193, - "y": 312 - }, - "type": "call", - "data": { - "id": "Agama-call-Node-79fe19f6-c785-4427-a44e-84a764cdce7b", - "type": "Agama-call-Node", - "parentId": "Agama-call-Node-dc6eb05b-fd54-46ca-9ea2-7f46a4204e04", - "whenCondition": "", - "inRepeatBlock": false, - "position": { - "x": 2193, - "y": 312 - }, - "agamaData": { - "id": "Agama-call-Node-79fe19f6-c785-4427-a44e-84a764cdce7b", - "parentId": "Agama-call-Node-dc6eb05b-fd54-46ca-9ea2-7f46a4204e04", - "type": "Agama-call-Node", - "displayName": "Create phrase map", - "hasComment": true, - "comment": "", - "javaClassName": "", - "javaMethodName": "getPhraseMap", - "javaVariableName": "tk", - "exceptionVariableField": "", - "callType": "Call method on instance", - "whenCondition": "", - "inRepeatBlock": false, - "arguments": [ - "random_usecase" - ], - "nodeIcon": "material-symbols:code", - "asssignedVariableName": "phrase_map" - }, - "skake": false - }, - "positionAbsolute": { - "x": 2193, - "y": 312 - }, - "selected": false, - "dragging": false - }, - { - "width": 170, - "height": 123, - "id": "Agama-call-Node-dc6eb05b-fd54-46ca-9ea2-7f46a4204e04", - "position": { - "x": 1993, - "y": 313 - }, - "type": "call", - "data": { - "id": "Agama-call-Node-dc6eb05b-fd54-46ca-9ea2-7f46a4204e04", - "type": "Agama-call-Node", - "parentId": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e", - "whenCondition": "WhenTrue", - "inRepeatBlock": false, - "position": { - "x": 1993, - "y": 313 - }, - "agamaData": { - "id": "Agama-call-Node-dc6eb05b-fd54-46ca-9ea2-7f46a4204e04", - "parentId": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e", - "type": "Agama-call-Node", - "displayName": "Choose random usecase", - "hasComment": true, - "comment": "", - "javaClassName": "", - "javaMethodName": "getRandomUseCase", - "javaVariableName": "tk", - "exceptionVariableField": "", - "callType": "Call method on instance", - "whenCondition": "WhenTrue", - "inRepeatBlock": false, - "arguments": [], - "nodeIcon": "material-symbols:code", - "asssignedVariableName": "random_usecase" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 1993, - "y": 313 - } - }, - { - "width": 210, - "height": 140, - "id": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e", - "position": { - "x": 1880, - "y": 83 - }, - "parentId": "Agama-call-Node-5a00f24d-5802-4e24-beff-a5d0711a4b1b", - "type": "when", - "data": { - "id": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e", - "type": "Agama-when-Node", - "parentId": "Agama-call-Node-5a00f24d-5802-4e24-beff-a5d0711a4b1b", - "whenCondition": "", - "inRepeatBlock": false, - "position": { - "x": 1880, - "y": 83 - }, - "agamaData": { - "id": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e", - "parentId": "Agama-call-Node-5a00f24d-5802-4e24-beff-a5d0711a4b1b", - "type": "Agama-when-Node", - "variableField": "enrolled", - "conditionInputField": "is", - "valueField": "false", - "hasComment": true, - "inRepeatBlock": false, - "hasSuccess": true, - "hasFailure": true, - "hasNoRepeat": false, - "hasRepeat": false - }, - "handles": [ - "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e.FAILURE", - "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e.SUCCESS" - ], - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 1880, - "y": 83 - } - }, - { - "width": 170, - "height": 123, - "id": "Agama-call-Node-5a00f24d-5802-4e24-beff-a5d0711a4b1b", - "position": { - "x": 1680, - "y": 29 - }, - "type": "call", - "data": { - "id": "Agama-call-Node-5a00f24d-5802-4e24-beff-a5d0711a4b1b", - "type": "Agama-call-Node", - "parentId": "Agama-call-Node-6801e7ba-57f9-4e03-b9bc-e89c1b716767", - "whenCondition": "", - "inRepeatBlock": false, - "position": { - "x": 1680, - "y": 29 - }, - "agamaData": { - "id": "Agama-call-Node-5a00f24d-5802-4e24-beff-a5d0711a4b1b", - "parentId": "Agama-call-Node-6801e7ba-57f9-4e03-b9bc-e89c1b716767", - "type": "Agama-call-Node", - "displayName": "Check enrollment", - "hasComment": true, - "comment": "", - "javaClassName": "", - "javaMethodName": "enrolled", - "javaVariableName": "idp", - "exceptionVariableField": "", - "callType": "Call method on instance", - "whenCondition": "", - "inRepeatBlock": false, - "arguments": [ - "user.username" - ], - "nodeIcon": "material-symbols:code", - "asssignedVariableName": "enrolled" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 1680, - "y": 29 - } - }, - { - "width": 170, - "height": 123, - "id": "Agama-call-Node-6801e7ba-57f9-4e03-b9bc-e89c1b716767", - "position": { - "x": 1480, - "y": 30 - }, - "type": "call", - "data": { - "id": "Agama-call-Node-6801e7ba-57f9-4e03-b9bc-e89c1b716767", - "type": "Agama-call-Node", - "parentId": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9", - "whenCondition": "WhenFalse", - "inRepeatBlock": false, - "position": { - "x": 1480, - "y": 30 - }, - "agamaData": { - "id": "Agama-call-Node-6801e7ba-57f9-4e03-b9bc-e89c1b716767", - "parentId": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9", - "type": "Agama-call-Node", - "displayName": "Typekey", - "hasComment": true, - "comment": "", - "javaClassName": "org.gluu.agama.typekey.Typekey", - "javaMethodName": "", - "javaVariableName": "", - "exceptionVariableField": "", - "callType": "Create an instance", - "whenCondition": "WhenFalse", - "inRepeatBlock": false, - "arguments": "conf", - "nodeIcon": "material-symbols:code", - "asssignedVariableName": "tk" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 1480, - "y": 30 - } - }, - { - "width": 170, - "height": 123, - "id": "finish-fc8a96fc-d92c-4af6-baba-c27a38b1679a", - "position": { - "x": 1343, - "y": 314 - }, - "type": "finish", - "data": { - "id": "finish-fc8a96fc-d92c-4af6-baba-c27a38b1679a", - "type": "Agama-finish-Flow", - "parentId": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9", - "whenCondition": "WhenTrue", - "inRepeatBlock": false, - "handles": [ - "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9.FAILURE", - "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9.SUCCESS" - ], - "position": { - "x": 1343, - "y": 314 - }, - "agamaData": { - "id": "finish-fc8a96fc-d92c-4af6-baba-c27a38b1679a", - "parentId": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9", - "type": "Agama-finish-Flow", - "hasSuccess": false, - "hasFailure": false, - "hasComment": true, - "comment": "", - "flowfilename": "", - "returnVariable": "Account not found", - "finishMode": "withFailure", - "nodeIcon": "material-symbols:line-end-square-rounded", - "displayName": "Account not found" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 1343, - "y": 314 - } - }, - { - "width": 210, - "height": 140, - "id": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9", - "position": { - "x": 1230, - "y": 84 - }, - "parentId": "Agama-call-Node-98947a11-0b89-40f2-9095-e499de14b28b", - "type": "when", - "data": { - "id": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9", - "type": "Agama-when-Node", - "parentId": "Agama-call-Node-98947a11-0b89-40f2-9095-e499de14b28b", - "whenCondition": "", - "inRepeatBlock": false, - "position": { - "x": 1230, - "y": 84 - }, - "agamaData": { - "id": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9", - "parentId": "Agama-call-Node-98947a11-0b89-40f2-9095-e499de14b28b", - "type": "Agama-when-Node", - "variableField": "userData.empty", - "conditionInputField": "is", - "valueField": "true", - "hasComment": true, - "inRepeatBlock": false, - "hasSuccess": true, - "hasFailure": true - }, - "handles": [ - "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9.FAILURE", - "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9.SUCCESS" - ], - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 1230, - "y": 84 - } - }, - { - "width": 170, - "height": 123, - "id": "Agama-call-Node-98947a11-0b89-40f2-9095-e499de14b28b", - "position": { - "x": 1030, - "y": 30 - }, - "type": "call", - "data": { - "id": "Agama-call-Node-98947a11-0b89-40f2-9095-e499de14b28b", - "type": "Agama-call-Node", - "parentId": "Agama-call-Node-3f0a4b7d-f6ea-40b3-90c9-8273148ea4c1", - "whenCondition": "", - "inRepeatBlock": false, - "position": { - "x": 1030, - "y": 30 - }, - "agamaData": { - "id": "Agama-call-Node-98947a11-0b89-40f2-9095-e499de14b28b", - "parentId": "Agama-call-Node-3f0a4b7d-f6ea-40b3-90c9-8273148ea4c1", - "type": "Agama-call-Node", - "displayName": "Find account", - "hasComment": true, - "comment": "", - "javaClassName": "", - "javaMethodName": "accountFromUsername", - "javaVariableName": "idp", - "exceptionVariableField": "", - "callType": "Call method on instance", - "whenCondition": "", - "inRepeatBlock": false, - "arguments": "user.username", - "nodeIcon": "material-symbols:code", - "asssignedVariableName": "userData" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 1030, - "y": 30 - } - }, - { - "width": 170, - "height": 123, - "id": "Agama-call-Node-3f0a4b7d-f6ea-40b3-90c9-8273148ea4c1", - "position": { - "x": 830, - "y": 30 - }, - "type": "call", - "data": { - "id": "Agama-call-Node-3f0a4b7d-f6ea-40b3-90c9-8273148ea4c1", - "type": "Agama-call-Node", - "parentId": "Agama-rrf-Node-6d70dd8f-a2c1-4c17-bd54-6194739d1661", - "whenCondition": "", - "inRepeatBlock": false, - "position": { - "x": 830, - "y": 30 - }, - "agamaData": { - "id": "Agama-call-Node-3f0a4b7d-f6ea-40b3-90c9-8273148ea4c1", - "parentId": "Agama-rrf-Node-6d70dd8f-a2c1-4c17-bd54-6194739d1661", - "type": "Agama-call-Node", - "displayName": "Identity Processor", - "hasComment": true, - "comment": "", - "javaClassName": "org.gluu.agama.typekey.IdentityProcessor", - "javaMethodName": "", - "javaVariableName": "", - "exceptionVariableField": "", - "callType": "Create an instance", - "whenCondition": "", - "inRepeatBlock": false, - "arguments": "", - "nodeIcon": "material-symbols:code", - "asssignedVariableName": "idp" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 830, - "y": 30 - } - }, - { - "width": 170, - "height": 123, - "id": "Agama-rrf-Node-6d70dd8f-a2c1-4c17-bd54-6194739d1661", - "position": { - "x": 630, - "y": 30 - }, - "type": "rrf", - "data": { - "id": "Agama-rrf-Node-6d70dd8f-a2c1-4c17-bd54-6194739d1661", - "type": "Agama-rrf-Node", - "parentId": "Agama-assignment-Node-787ce1ac-a1ab-46dd-a872-2bccd1d41024", - "whenCondition": "", - "inRepeatBlock": false, - "position": { - "x": 630, - "y": 30 - }, - "agamaData": { - "id": "Agama-rrf-Node-6d70dd8f-a2c1-4c17-bd54-6194739d1661", - "parentId": "Agama-assignment-Node-787ce1ac-a1ab-46dd-a872-2bccd1d41024", - "type": "Agama-rrf-Node", - "displayName": "Username page", - "hasComment": true, - "comment": "", - "whenCondition": "", - "inRepeatBlock": false, - "assignments": [], - "nodeIcon": "ph:globe-simple", - "templatePath": "typekey/username.ftlh", - "asssignedVariableName": "user", - "arguments": "user" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 630, - "y": 30 - } - }, - { - "width": 170, - "height": 123, - "id": "Agama-assignment-Node-787ce1ac-a1ab-46dd-a872-2bccd1d41024", - "position": { - "x": 430, - "y": 30 - }, - "type": "assignment", - "data": { - "id": "Agama-assignment-Node-787ce1ac-a1ab-46dd-a872-2bccd1d41024", - "type": "Agama-assignment-Node", - "parentId": "Agama-log-Node-5b96d049-463b-4626-9f54-2476d83d3373", - "whenCondition": "", - "inRepeatBlock": false, - "position": { - "x": 430, - "y": 30 - }, - "agamaData": { - "id": "Agama-assignment-Node-787ce1ac-a1ab-46dd-a872-2bccd1d41024", - "parentId": "Agama-log-Node-5b96d049-463b-4626-9f54-2476d83d3373", - "type": "Agama-assignment-Node", - "displayName": "Variables", - "hasComment": true, - "comment": "", - "whenCondition": "", - "inRepeatBlock": false, - "assignments": [ - { - "variableTypeCheck": false, - "assignmentExpression": "{}", - "assignedVariableName": "user" - }, - { - "variableTypeCheck": false, - "assignmentExpression": "{}", - "assignedVariableName": "password" - }, - { - "variableTypeCheck": false, - "assignmentExpression": "{}", - "assignedVariableName": "typekey" - } - ], - "nodeIcon": "material-symbols:equal" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 430, - "y": 30 - } - }, - { - "width": 170, - "height": 123, - "id": "Agama-log-Node-5b96d049-463b-4626-9f54-2476d83d3373", - "position": { - "x": 230, - "y": 30 - }, - "type": "log", - "data": { - "id": "Agama-log-Node-5b96d049-463b-4626-9f54-2476d83d3373", - "type": "Agama-log-Node", - "parentId": "Agama-start-Flow-44b531f0-ded9-4150-a165-b30552ca93f9", - "whenCondition": "", - "inRepeatBlock": false, - "position": { - "x": 230, - "y": 30 - }, - "agamaData": { - "id": "Agama-log-Node-5b96d049-463b-4626-9f54-2476d83d3373", - "parentId": "Agama-start-Flow-44b531f0-ded9-4150-a165-b30552ca93f9", - "type": "Agama-log-Node", - "displayName": "", - "hasComment": true, - "comment": "", - "whenCondition": "", - "inRepeatBlock": false, - "logMessage": "Starting Typekey Authentication", - "logLevel": "info", - "nodeIcon": "octicon:log-16" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 230, - "y": 30 - } - }, - { - "width": 170, - "height": 123, - "id": "Agama-start-Flow-44b531f0-ded9-4150-a165-b30552ca93f9", - "type": "start", - "sourcePosition": "right", - "data": { - "id": "Agama-start-Flow-44b531f0-ded9-4150-a165-b30552ca93f9", - "type": "Agama-start-Flow", - "position": { - "x": 30, - "y": 30 - }, - "inRepeatBlock": false, - "agamaData": { - "id": "Agama-start-Flow-44b531f0-ded9-4150-a165-b30552ca93f9", - "type": "Agama-start-Flow", - "displayName": "Typekey", - "hasComment": true, - "comment": "", - "isTopLevelFlow": true, - "basepath": "", - "configParams": "{\n \"keystoreName\": \"\",\n \"keystorePassword\": \"\",\n \"orgId\": \"\",\n \"clientId\": \"\",\n \"clientSecret\": \"\",\n \"authHost\": \"https://account.gluu.org\",\n \"scanHost\": \"https://cloud.gluu.org\",\n \"phrases\": {\n \"1\": \"Lorem Ipsum\",\n \"2\": \"Dolor Si Amet\"\n }\n}", - "nodeIcon": "material-symbols:line-start-square", - "timeout": "", - "inputs": "", - "configs": "conf", - "flowname": "org.gluu.agama.typekey" - }, - "skake": false - }, - "position": { - "x": 30, - "y": 30 - }, - "selected": true, - "dragging": false, - "positionAbsolute": { - "x": 30, - "y": 30 - } - } - ], - "edges": [ - { - "id": "Agama-start-Flow-44b531f0-ded9-4150-a165-b30552ca93f9-Agama-log-Node-5b96d049-463b-4626-9f54-2476d83d3373-b1566c4c-9752-46e0-93d2-6d9630554645", - "type": "straight", - "source": "Agama-start-Flow-44b531f0-ded9-4150-a165-b30552ca93f9", - "target": "Agama-log-Node-5b96d049-463b-4626-9f54-2476d83d3373", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - } - }, - { - "id": "Agama-log-Node-5b96d049-463b-4626-9f54-2476d83d3373-Agama-assignment-Node-787ce1ac-a1ab-46dd-a872-2bccd1d41024-41ecf761-31f8-48f8-b38f-51ff9f041977", - "type": "straight", - "source": "Agama-log-Node-5b96d049-463b-4626-9f54-2476d83d3373", - "target": "Agama-assignment-Node-787ce1ac-a1ab-46dd-a872-2bccd1d41024", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - } - }, - { - "id": "Agama-assignment-Node-787ce1ac-a1ab-46dd-a872-2bccd1d41024-Agama-rrf-Node-6d70dd8f-a2c1-4c17-bd54-6194739d1661-77de0cff-0f85-4923-a11a-2a2a9c3b6762", - "type": "straight", - "source": "Agama-assignment-Node-787ce1ac-a1ab-46dd-a872-2bccd1d41024", - "target": "Agama-rrf-Node-6d70dd8f-a2c1-4c17-bd54-6194739d1661", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - } - }, - { - "id": "Agama-rrf-Node-6d70dd8f-a2c1-4c17-bd54-6194739d1661-Agama-call-Node-3f0a4b7d-f6ea-40b3-90c9-8273148ea4c1-21ce0f6f-1228-48dc-b799-9c5636f6c74e", - "type": "straight", - "source": "Agama-rrf-Node-6d70dd8f-a2c1-4c17-bd54-6194739d1661", - "target": "Agama-call-Node-3f0a4b7d-f6ea-40b3-90c9-8273148ea4c1", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - } - }, - { - "id": "Agama-call-Node-3f0a4b7d-f6ea-40b3-90c9-8273148ea4c1-Agama-call-Node-98947a11-0b89-40f2-9095-e499de14b28b-f69bceec-5d0a-47b3-b515-9908c88f3cb0", - "type": "straight", - "source": "Agama-call-Node-3f0a4b7d-f6ea-40b3-90c9-8273148ea4c1", - "target": "Agama-call-Node-98947a11-0b89-40f2-9095-e499de14b28b", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - } - }, - { - "id": "Agama-call-Node-98947a11-0b89-40f2-9095-e499de14b28b-Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9-b1ae1687-0b1e-4400-86ba-da236efce3d1", - "type": "straight", - "source": "Agama-call-Node-98947a11-0b89-40f2-9095-e499de14b28b", - "target": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - } - }, - { - "id": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9-finish-fc8a96fc-d92c-4af6-baba-c27a38b1679a-6e527c69-292e-49fc-b85f-d820b234e5dc", - "type": "straight", - "source": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9", - "target": "finish-fc8a96fc-d92c-4af6-baba-c27a38b1679a", - "label": "Condition met", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - }, - "sourceHandle": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9.SUCCESS" - }, - { - "id": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9-Agama-call-Node-6801e7ba-57f9-4e03-b9bc-e89c1b716767-e4a00b5d-9157-42ad-a8db-14a0d37c97c9", - "type": "straight", - "source": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9", - "target": "Agama-call-Node-6801e7ba-57f9-4e03-b9bc-e89c1b716767", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - }, - "sourceHandle": "Agama-when-Node-55f90615-3495-4c34-87aa-07936df643a9.FAILURE" - }, - { - "id": "Agama-call-Node-6801e7ba-57f9-4e03-b9bc-e89c1b716767-Agama-call-Node-5a00f24d-5802-4e24-beff-a5d0711a4b1b-6d5e3b5c-62a5-4099-8a53-264c15f0d0ff", - "type": "straight", - "source": "Agama-call-Node-6801e7ba-57f9-4e03-b9bc-e89c1b716767", - "target": "Agama-call-Node-5a00f24d-5802-4e24-beff-a5d0711a4b1b", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - } - }, - { - "id": "Agama-call-Node-5a00f24d-5802-4e24-beff-a5d0711a4b1b-Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e-39af352a-fc7d-4e03-814f-f058f89b8203", - "type": "straight", - "source": "Agama-call-Node-5a00f24d-5802-4e24-beff-a5d0711a4b1b", - "target": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - } - }, - { - "id": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e-Agama-call-Node-dc6eb05b-fd54-46ca-9ea2-7f46a4204e04-45e7d9e6-142e-45c5-b580-0c41e7162a4c", - "type": "straight", - "source": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e", - "target": "Agama-call-Node-dc6eb05b-fd54-46ca-9ea2-7f46a4204e04", - "label": "Condition met", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - }, - "sourceHandle": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e.SUCCESS" - }, - { - "id": "Agama-call-Node-dc6eb05b-fd54-46ca-9ea2-7f46a4204e04-Agama-call-Node-79fe19f6-c785-4427-a44e-84a764cdce7b-b1081f7f-6f0f-4e96-bd3b-a253bcd1deb7", - "type": "straight", - "source": "Agama-call-Node-dc6eb05b-fd54-46ca-9ea2-7f46a4204e04", - "target": "Agama-call-Node-79fe19f6-c785-4427-a44e-84a764cdce7b", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - } - }, - { - "id": "Agama-call-Node-79fe19f6-c785-4427-a44e-84a764cdce7b-Agama-call-Node-0117bbe2-bcbf-4405-ae96-0b688a5487fc-8048d0ee-a6be-4a36-aa40-c796baeeb89f", - "type": "straight", - "source": "Agama-call-Node-79fe19f6-c785-4427-a44e-84a764cdce7b", - "target": "Agama-call-Node-0117bbe2-bcbf-4405-ae96-0b688a5487fc", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - } - }, - { - "id": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e-finish-b23ed1c4-6a3f-45af-b6bf-159bae1ea4a0-5b709231-4c75-408c-a6be-6c75dd7151db", - "type": "straight", - "source": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e", - "target": "finish-b23ed1c4-6a3f-45af-b6bf-159bae1ea4a0", - "label": "", - "labelBgPadding": [ - 8, - 4 - ], - "labelBgBorderRadius": 4, - "labelBgStyle": { - "fill": "#FFCC00", - "color": "#fff", - "fillOpacity": 0.7 - }, - "sourceHandle": "Agama-when-Node-bdd6b4a8-a352-4a35-ad4f-cf60d0459f9e.FAILURE" - } - ], - "viewport": { - "x": 10, - "y": 15, - "zoom": 1 - } -} \ No newline at end of file From 57d16d80c05089e004386b988985b07f5b4c56f6 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:51:20 -0600 Subject: [PATCH 03/38] feat: update project.json --- project.json | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/project.json b/project.json index a196eaa..a847860 100644 --- a/project.json +++ b/project.json @@ -13,19 +13,6 @@ ], "noDirectLaunch": [], "configs": { - "org.gluu.agama.typekey": { - "keystoreName": "", - "keystorePassword": "", - "orgId": "", - "clientId": "", - "clientSecret": "", - "authHost": "https://account.gluu.org", - "scanHost": "https://cloud.gluu.org", - "phrases": { - "1": "Lorem Ipsum", - "2": "Dolor Si Amet" - } - }, "": { "keystoreName": "", "keystorePassword": "", From f7def381187f9c63632957c044e7dddbbb2a41e5 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:51:39 -0600 Subject: [PATCH 04/38] feat: add org.gluu.agama.typekey.json --- code/org.gluu.agama.typekey.json | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 code/org.gluu.agama.typekey.json diff --git a/code/org.gluu.agama.typekey.json b/code/org.gluu.agama.typekey.json new file mode 100644 index 0000000..5ef7412 --- /dev/null +++ b/code/org.gluu.agama.typekey.json @@ -0,0 +1,39 @@ +[ + { + "id": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", + "type": "start", + "sourcePosition": "right", + "data": { + "id": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", + "type": "Agama-start-Flow", + "position": { + "x": 30, + "y": 30 + }, + "inRepeatBlock": false, + "agamaData": { + "id": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", + "type": "Agama-start-Flow", + "displayName": "Typekey", + "hasComment": true, + "comment": "", + "isTopLevelFlow": true, + "basepath": "", + "configParams": "{}", + "nodeIcon": "material-symbols:line-start-square", + "timeout": "", + "inputs": "", + "configs": "", + "hasSuccess": "", + "hasFailure": "", + "hasNoRepeat": false, + "hasRepeat": false, + "flowname": "org.gluu.agama.typekey" + } + }, + "position": { + "x": 30, + "y": 30 + } + } +] \ No newline at end of file From 023b9189817b9c7f6d7b433b4fff9876da5ceb54 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:51:40 -0600 Subject: [PATCH 05/38] feat: add org.gluu.agama.typekey.flow --- code/org.gluu.agama.typekey.flow | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 code/org.gluu.agama.typekey.flow diff --git a/code/org.gluu.agama.typekey.flow b/code/org.gluu.agama.typekey.flow new file mode 100644 index 0000000..e4d8a1d --- /dev/null +++ b/code/org.gluu.agama.typekey.flow @@ -0,0 +1,2 @@ +Flow org.gluu.agama.typekey + Basepath "" \ No newline at end of file From 14ba5bbe84adb3a9e7b6968e97801743d8e94dea Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:51:41 -0600 Subject: [PATCH 06/38] feat: update project.json --- project.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project.json b/project.json index a847860..cb8c77f 100644 --- a/project.json +++ b/project.json @@ -25,7 +25,8 @@ "1": "Lorem Ipsum", "2": "Dolor Si Amet" } - } + }, + "org.gluu.agama.typekey": {} }, "name": "agama-typekey" } \ No newline at end of file From aedd798e1a09a76df8638a8e0682b89d6c9c789f Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:14:34 -0600 Subject: [PATCH 07/38] feat: update project.json From 2d306c4671640a1175cc165170f215db19eaa01d Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:14:35 -0600 Subject: [PATCH 08/38] feat: update org.gluu.agama.typekey.json --- code/org.gluu.agama.typekey.json | 980 +++++++++++++++++++++++++++++-- 1 file changed, 941 insertions(+), 39 deletions(-) diff --git a/code/org.gluu.agama.typekey.json b/code/org.gluu.agama.typekey.json index 5ef7412..33206e4 100644 --- a/code/org.gluu.agama.typekey.json +++ b/code/org.gluu.agama.typekey.json @@ -1,39 +1,941 @@ -[ - { - "id": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", - "type": "start", - "sourcePosition": "right", - "data": { - "id": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", - "type": "Agama-start-Flow", - "position": { - "x": 30, - "y": 30 - }, - "inRepeatBlock": false, - "agamaData": { - "id": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", - "type": "Agama-start-Flow", - "displayName": "Typekey", - "hasComment": true, - "comment": "", - "isTopLevelFlow": true, - "basepath": "", - "configParams": "{}", - "nodeIcon": "material-symbols:line-start-square", - "timeout": "", - "inputs": "", - "configs": "", - "hasSuccess": "", - "hasFailure": "", - "hasNoRepeat": false, - "hasRepeat": false, - "flowname": "org.gluu.agama.typekey" - } - }, - "position": { - "x": 30, - "y": 30 - } - } -] \ No newline at end of file +{ + "nodes": [ + { + "width": 170, + "height": 123, + "id": "finish-02d289ca-d578-47b4-9d54-4adf3f52bc3b", + "position": { + "x": 1931, + "y": 30 + }, + "type": "finish", + "data": { + "id": "finish-02d289ca-d578-47b4-9d54-4adf3f52bc3b", + "type": "Agama-finish-Flow", + "parentId": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "handles": [ + "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.FAILURE", + "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.SUCCESS" + ], + "position": { + "x": 1931, + "y": 30 + }, + "agamaData": { + "id": "finish-02d289ca-d578-47b4-9d54-4adf3f52bc3b", + "parentId": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasComment": true, + "comment": "", + "flowfilename": "", + "returnVariable": "{ userId: \"as9233Qz\", property1: \"value1\"}", + "finishMode": "withSuccess", + "nodeIcon": "material-symbols:line-end-square-rounded" + } + }, + "selected": true, + "dragging": false, + "positionAbsolute": { + "x": 1931, + "y": 30 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-assignment-Node-18afb1da-bc24-48ce-8913-f047c5a09f3e", + "position": { + "x": 2394, + "y": 314 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-18afb1da-bc24-48ce-8913-f047c5a09f3e", + "type": "Agama-assignment-Node", + "parentId": "Agama-call-Node-cb8fb652-067f-4528-84b0-3e28cfa6b696", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 2394, + "y": 314 + }, + "agamaData": { + "id": "Agama-assignment-Node-18afb1da-bc24-48ce-8913-f047c5a09f3e", + "parentId": "Agama-call-Node-cb8fb652-067f-4528-84b0-3e28cfa6b696", + "type": "Agama-assignment-Node", + "displayName": "Variables for use", + "hasComment": true, + "comment": "", + "whenCondition": "", + "inRepeatBlock": false, + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "phrase_map.phrase", + "assignedVariableName": "phrase" + }, + { + "variableTypeCheck": false, + "assignmentExpression": "random_usecase", + "assignedVariableName": "use_case" + } + ], + "nodeIcon": "material-symbols:equal" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2394, + "y": 314 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-cb8fb652-067f-4528-84b0-3e28cfa6b696", + "position": { + "x": 2194, + "y": 314 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-cb8fb652-067f-4528-84b0-3e28cfa6b696", + "type": "Agama-call-Node", + "parentId": "Agama-call-Node-c03201dd-43c9-4658-b02d-266bc506c4b4", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 2194, + "y": 314 + }, + "agamaData": { + "id": "Agama-call-Node-cb8fb652-067f-4528-84b0-3e28cfa6b696", + "parentId": "Agama-call-Node-c03201dd-43c9-4658-b02d-266bc506c4b4", + "type": "Agama-call-Node", + "displayName": "Persist enrollment data in db", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "enroll", + "javaVariableName": "idp", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "", + "inRepeatBlock": false, + "arguments": [ + "user.username", + "phrase_map" + ], + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "dummy" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2194, + "y": 314 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-c03201dd-43c9-4658-b02d-266bc506c4b4", + "position": { + "x": 1994, + "y": 314 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-c03201dd-43c9-4658-b02d-266bc506c4b4", + "type": "Agama-call-Node", + "parentId": "Agama-call-Node-9b413363-7271-4e15-bfb0-3ab450e9cdd2", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1994, + "y": 314 + }, + "agamaData": { + "id": "Agama-call-Node-c03201dd-43c9-4658-b02d-266bc506c4b4", + "parentId": "Agama-call-Node-9b413363-7271-4e15-bfb0-3ab450e9cdd2", + "type": "Agama-call-Node", + "displayName": "Generate phrase map", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "generateTypekeyData", + "javaVariableName": "tk", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "", + "inRepeatBlock": false, + "arguments": [ + "random_usecase" + ], + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "phrase_map" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1994, + "y": 314 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-9b413363-7271-4e15-bfb0-3ab450e9cdd2", + "position": { + "x": 1794, + "y": 314 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-9b413363-7271-4e15-bfb0-3ab450e9cdd2", + "type": "Agama-call-Node", + "parentId": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "position": { + "x": 1794, + "y": 314 + }, + "agamaData": { + "id": "Agama-call-Node-9b413363-7271-4e15-bfb0-3ab450e9cdd2", + "parentId": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "type": "Agama-call-Node", + "displayName": "Get random phrase", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "getRandomUseCase", + "javaVariableName": "tk", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "arguments": [], + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "random_usecase" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1794, + "y": 314 + } + }, + { + "width": 210, + "height": 140, + "id": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "position": { + "x": 1681, + "y": 84 + }, + "parentId": "Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437", + "type": "when", + "data": { + "id": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "type": "Agama-when-Node", + "parentId": "Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1681, + "y": 84 + }, + "agamaData": { + "id": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "parentId": "Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437", + "type": "Agama-when-Node", + "conditions": [ + { + "variable": "enrolled", + "operator": "is", + "dataValue": "false", + "combinator": "none" + } + ], + "hasComment": true, + "inRepeatBlock": false, + "hasSuccess": true, + "hasFailure": true + }, + "handles": [ + "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.FAILURE", + "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.SUCCESS" + ] + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1681, + "y": 84 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437", + "position": { + "x": 1481, + "y": 30 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437", + "type": "Agama-call-Node", + "parentId": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "position": { + "x": 1481, + "y": 30 + }, + "agamaData": { + "id": "Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437", + "parentId": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14", + "type": "Agama-call-Node", + "displayName": "Check for enrollment", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "enrolled", + "javaVariableName": "idp", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "arguments": "user.username", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "enrolled" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1481, + "y": 30 + } + }, + { + "width": 170, + "height": 123, + "id": "finish-33cdcb56-e9d6-4b22-b4a6-52120130acd3", + "position": { + "x": 1344, + "y": 314 + }, + "type": "finish", + "data": { + "id": "finish-33cdcb56-e9d6-4b22-b4a6-52120130acd3", + "type": "Agama-finish-Flow", + "parentId": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "handles": [ + "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14.FAILURE", + "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14.SUCCESS" + ], + "position": { + "x": 1344, + "y": 314 + }, + "agamaData": { + "id": "finish-33cdcb56-e9d6-4b22-b4a6-52120130acd3", + "parentId": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasComment": true, + "comment": "", + "flowfilename": "", + "returnVariable": "User not found", + "finishMode": "withFailure", + "nodeIcon": "material-symbols:line-end-square-rounded", + "displayName": "User not found" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1344, + "y": 314 + } + }, + { + "width": 210, + "height": 140, + "id": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14", + "position": { + "x": 1231, + "y": 84 + }, + "parentId": "Agama-call-Node-bb95dcda-143e-4737-b44a-eac539d00b56", + "type": "when", + "data": { + "id": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14", + "type": "Agama-when-Node", + "parentId": "Agama-call-Node-bb95dcda-143e-4737-b44a-eac539d00b56", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1231, + "y": 84 + }, + "agamaData": { + "id": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14", + "parentId": "Agama-call-Node-bb95dcda-143e-4737-b44a-eac539d00b56", + "type": "Agama-when-Node", + "conditions": [ + { + "variable": "userData.empty", + "operator": "is", + "dataValue": "true", + "combinator": "none" + } + ], + "hasComment": true, + "inRepeatBlock": false, + "hasSuccess": true, + "hasFailure": true + }, + "handles": [ + "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14.FAILURE", + "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14.SUCCESS" + ] + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1231, + "y": 84 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-bb95dcda-143e-4737-b44a-eac539d00b56", + "position": { + "x": 1031, + "y": 30 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-bb95dcda-143e-4737-b44a-eac539d00b56", + "type": "Agama-call-Node", + "parentId": "Agama-rrf-Node-e499710a-f88c-45b6-96e9-3b5597617b9d", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1031, + "y": 30 + }, + "agamaData": { + "id": "Agama-call-Node-bb95dcda-143e-4737-b44a-eac539d00b56", + "parentId": "Agama-rrf-Node-e499710a-f88c-45b6-96e9-3b5597617b9d", + "type": "Agama-call-Node", + "displayName": "Find user", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "accountFromUsername", + "javaVariableName": "idp", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "", + "inRepeatBlock": false, + "arguments": "user.username", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "userData" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1031, + "y": 30 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-rrf-Node-e499710a-f88c-45b6-96e9-3b5597617b9d", + "position": { + "x": 830, + "y": 30 + }, + "type": "rrf", + "data": { + "id": "Agama-rrf-Node-e499710a-f88c-45b6-96e9-3b5597617b9d", + "type": "Agama-rrf-Node", + "parentId": "Agama-call-Node-ba49fd6e-337e-412f-aa6f-445f285a180e", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 830, + "y": 30 + }, + "agamaData": { + "id": "Agama-rrf-Node-e499710a-f88c-45b6-96e9-3b5597617b9d", + "parentId": "Agama-call-Node-ba49fd6e-337e-412f-aa6f-445f285a180e", + "type": "Agama-rrf-Node", + "displayName": "Get username", + "hasComment": true, + "comment": "", + "whenCondition": "", + "inRepeatBlock": false, + "assignments": [], + "nodeIcon": "ph:globe-simple", + "templatePath": "typekey/username.ftlh", + "asssignedVariableName": "user" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 830, + "y": 30 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-ba49fd6e-337e-412f-aa6f-445f285a180e", + "position": { + "x": 630, + "y": 30 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-ba49fd6e-337e-412f-aa6f-445f285a180e", + "type": "Agama-call-Node", + "parentId": "Agama-call-Node-55aa41cb-8923-408e-94a2-34ba1eb37035", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 630, + "y": 30 + }, + "agamaData": { + "id": "Agama-call-Node-ba49fd6e-337e-412f-aa6f-445f285a180e", + "parentId": "Agama-call-Node-55aa41cb-8923-408e-94a2-34ba1eb37035", + "type": "Agama-call-Node", + "displayName": "Typekey object", + "hasComment": true, + "comment": "", + "javaClassName": "org.gluu.agama.typekey.Typekey", + "javaMethodName": "", + "javaVariableName": "", + "exceptionVariableField": "", + "callType": "Create an instance", + "whenCondition": "", + "inRepeatBlock": false, + "arguments": "conf", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "tk" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 630, + "y": 30 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-55aa41cb-8923-408e-94a2-34ba1eb37035", + "position": { + "x": 430, + "y": 30 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-55aa41cb-8923-408e-94a2-34ba1eb37035", + "type": "Agama-call-Node", + "parentId": "Agama-log-Node-9cb7b51b-10e3-4b9a-baf3-fe92b0020eb9", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 430, + "y": 30 + }, + "agamaData": { + "id": "Agama-call-Node-55aa41cb-8923-408e-94a2-34ba1eb37035", + "parentId": "Agama-log-Node-9cb7b51b-10e3-4b9a-baf3-fe92b0020eb9", + "type": "Agama-call-Node", + "displayName": "Identity Processor", + "hasComment": true, + "comment": "", + "javaClassName": "org.gluu.agama.typekey.IdentityProcessor", + "javaMethodName": "", + "javaVariableName": "", + "exceptionVariableField": "", + "callType": "Create an instance", + "whenCondition": "", + "inRepeatBlock": false, + "arguments": "", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "idp" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 430, + "y": 30 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-log-Node-9cb7b51b-10e3-4b9a-baf3-fe92b0020eb9", + "position": { + "x": 230, + "y": 30 + }, + "type": "log", + "data": { + "id": "Agama-log-Node-9cb7b51b-10e3-4b9a-baf3-fe92b0020eb9", + "type": "Agama-log-Node", + "parentId": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 230, + "y": 30 + }, + "agamaData": { + "id": "Agama-log-Node-9cb7b51b-10e3-4b9a-baf3-fe92b0020eb9", + "parentId": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", + "type": "Agama-log-Node", + "displayName": "", + "hasComment": true, + "comment": "", + "whenCondition": "", + "inRepeatBlock": false, + "logMessage": "Starting typekey authentication", + "logLevel": "info", + "nodeIcon": "octicon:log-16", + "hasSuccess": "", + "hasFailure": "", + "hasNoRepeat": false, + "hasRepeat": false + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 230, + "y": 30 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", + "type": "start", + "sourcePosition": "right", + "data": { + "id": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", + "type": "Agama-start-Flow", + "position": { + "x": 30, + "y": 30 + }, + "inRepeatBlock": false, + "agamaData": { + "id": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", + "type": "Agama-start-Flow", + "displayName": "Typekey", + "hasComment": true, + "comment": "", + "isTopLevelFlow": true, + "basepath": "", + "configParams": "{}", + "nodeIcon": "material-symbols:line-start-square", + "timeout": "", + "inputs": "", + "configs": "", + "hasSuccess": "", + "hasFailure": "", + "hasNoRepeat": false, + "hasRepeat": false, + "flowname": "org.gluu.agama.typekey" + }, + "skake": false + }, + "position": { + "x": 30, + "y": 30 + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 30, + "y": 30 + } + } + ], + "edges": [ + { + "id": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97-Agama-log-Node-9cb7b51b-10e3-4b9a-baf3-fe92b0020eb9-fb8dc509-be93-47d6-9c2c-bfa1b4418e4f", + "type": "straight", + "source": "Agama-start-Flow-a59d8f2d-faed-4326-9c37-1534d16b3c97", + "target": "Agama-log-Node-9cb7b51b-10e3-4b9a-baf3-fe92b0020eb9", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-log-Node-9cb7b51b-10e3-4b9a-baf3-fe92b0020eb9-Agama-call-Node-55aa41cb-8923-408e-94a2-34ba1eb37035-b64f1752-3356-4d13-8f6b-ad665a92f66d", + "type": "straight", + "source": "Agama-log-Node-9cb7b51b-10e3-4b9a-baf3-fe92b0020eb9", + "target": "Agama-call-Node-55aa41cb-8923-408e-94a2-34ba1eb37035", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-55aa41cb-8923-408e-94a2-34ba1eb37035-Agama-call-Node-ba49fd6e-337e-412f-aa6f-445f285a180e-c5647214-1cf9-4314-91bb-beff61ea8410", + "type": "straight", + "source": "Agama-call-Node-55aa41cb-8923-408e-94a2-34ba1eb37035", + "target": "Agama-call-Node-ba49fd6e-337e-412f-aa6f-445f285a180e", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-ba49fd6e-337e-412f-aa6f-445f285a180e-Agama-rrf-Node-e499710a-f88c-45b6-96e9-3b5597617b9d-46905f66-0b2d-40f8-b438-3018ff8b5909", + "type": "straight", + "source": "Agama-call-Node-ba49fd6e-337e-412f-aa6f-445f285a180e", + "target": "Agama-rrf-Node-e499710a-f88c-45b6-96e9-3b5597617b9d", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-rrf-Node-e499710a-f88c-45b6-96e9-3b5597617b9d-Agama-call-Node-bb95dcda-143e-4737-b44a-eac539d00b56-d57f534b-e68f-4af9-a048-81b76c539aa9", + "type": "straight", + "source": "Agama-rrf-Node-e499710a-f88c-45b6-96e9-3b5597617b9d", + "target": "Agama-call-Node-bb95dcda-143e-4737-b44a-eac539d00b56", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-bb95dcda-143e-4737-b44a-eac539d00b56-Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14-337a4cc4-3535-46ee-b31a-21f43087c211", + "type": "straight", + "source": "Agama-call-Node-bb95dcda-143e-4737-b44a-eac539d00b56", + "target": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14-finish-33cdcb56-e9d6-4b22-b4a6-52120130acd3-b9391c6e-b21f-426b-9b75-94aaeb200bfb", + "type": "straight", + "source": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14", + "target": "finish-33cdcb56-e9d6-4b22-b4a6-52120130acd3", + "label": "Condition met", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14.SUCCESS" + }, + { + "id": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14-Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437-bcfe86ef-f39f-40cd-baa1-9914fe9e325f", + "type": "straight", + "source": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14", + "target": "Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14.FAILURE" + }, + { + "id": "Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437-Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49-d3e74fe3-206c-4814-a0a0-f142b6ddfc0b", + "type": "straight", + "source": "Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437", + "target": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49-Agama-call-Node-9b413363-7271-4e15-bfb0-3ab450e9cdd2-f2bfefd3-89e0-4d64-a64d-1c09158ff0d4", + "type": "straight", + "source": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "target": "Agama-call-Node-9b413363-7271-4e15-bfb0-3ab450e9cdd2", + "label": "Condition met", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.SUCCESS" + }, + { + "id": "Agama-call-Node-9b413363-7271-4e15-bfb0-3ab450e9cdd2-Agama-call-Node-c03201dd-43c9-4658-b02d-266bc506c4b4-b83bf734-1aad-4ab6-8637-991a027a6bc4", + "type": "straight", + "source": "Agama-call-Node-9b413363-7271-4e15-bfb0-3ab450e9cdd2", + "target": "Agama-call-Node-c03201dd-43c9-4658-b02d-266bc506c4b4", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-c03201dd-43c9-4658-b02d-266bc506c4b4-Agama-call-Node-cb8fb652-067f-4528-84b0-3e28cfa6b696-2e867baa-586e-4f06-8df0-752e208c7f10", + "type": "straight", + "source": "Agama-call-Node-c03201dd-43c9-4658-b02d-266bc506c4b4", + "target": "Agama-call-Node-cb8fb652-067f-4528-84b0-3e28cfa6b696", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-cb8fb652-067f-4528-84b0-3e28cfa6b696-Agama-assignment-Node-18afb1da-bc24-48ce-8913-f047c5a09f3e-6f382225-58e3-466f-8a1b-6a8a4e4dc3b9", + "type": "straight", + "source": "Agama-call-Node-cb8fb652-067f-4528-84b0-3e28cfa6b696", + "target": "Agama-assignment-Node-18afb1da-bc24-48ce-8913-f047c5a09f3e", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49-finish-02d289ca-d578-47b4-9d54-4adf3f52bc3b-a599e35f-404d-4644-9b2f-a265230862f1", + "type": "straight", + "source": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "target": "finish-02d289ca-d578-47b4-9d54-4adf3f52bc3b", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.FAILURE" + } + ], + "viewport": { + "x": -1699, + "y": 5, + "zoom": 1 + } +} \ No newline at end of file From a0e4d2a0a17214bf006d046eb8c23f392d7cd36b Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:14:36 -0600 Subject: [PATCH 09/38] feat: update org.gluu.agama.typekey.flow --- code/org.gluu.agama.typekey.flow | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/code/org.gluu.agama.typekey.flow b/code/org.gluu.agama.typekey.flow index e4d8a1d..5ac966f 100644 --- a/code/org.gluu.agama.typekey.flow +++ b/code/org.gluu.agama.typekey.flow @@ -1,2 +1,19 @@ Flow org.gluu.agama.typekey - Basepath "" \ No newline at end of file + Basepath "" +Log "@info " Starting typekey authentication +idp = Call org.gluu.agama.typekey.IdentityProcessor#new +tk = Call org.gluu.agama.typekey.Typekey#new conf +user = RRF "typekey/username.ftlh" +userData = Call idp accountFromUsername user.username +When userData.empty is true + it_wzqox = {success:false, error: "User not found"} + Finish it_wzqox +enrolled = Call idp enrolled user.username +When enrolled is false + random_usecase = Call tk getRandomUseCase + phrase_map = Call tk generateTypekeyData random_usecase + dummy = Call idp enroll user.username phrase_map + phrase = phrase_map.phrase + use_case = random_usecase +it_taewl = {success:true, data: { userId: "as9233Qz", property1: "value1"}} +Finish it_taewl \ No newline at end of file From 4530bf5a99214efcd69c2a62f7f9b96ca7e45581 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 8 Feb 2024 09:28:30 -0600 Subject: [PATCH 10/38] feat: add Typekey.java --- lib/org/gluu/agama/typekey/Typekey.java | 170 ++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 lib/org/gluu/agama/typekey/Typekey.java diff --git a/lib/org/gluu/agama/typekey/Typekey.java b/lib/org/gluu/agama/typekey/Typekey.java new file mode 100644 index 0000000..b3b7824 --- /dev/null +++ b/lib/org/gluu/agama/typekey/Typekey.java @@ -0,0 +1,170 @@ +package org.gluu.agama.typekey; + +import com.nimbusds.oauth2.sdk.http.HTTPRequest; +import com.nimbusds.oauth2.sdk.http.HTTPResponse; +import com.nimbusds.oauth2.sdk.ParseException; +import com.nimbusds.jwt.*; + +import io.jans.as.common.model.common.User; +import io.jans.as.common.service.common.UserService; +import io.jans.as.model.crypto.signature.SignatureAlgorithm; +import io.jans.as.model.crypto.AuthCryptoProvider; +import io.jans.service.cdi.util.CdiUtil; +import io.jans.util.StringHelper; + +import java.net.URL; +import java.net.URLEncoder; +import java.util.List; +import java.util.Map; +import java.util.Collections; +import java.util.HashMap; +import java.util.StringJoiner; +import java.util.stream.Collectors; +import java.util.Random; + +import org.json.JSONObject; +import org.json.JSONArray; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.entity.ContentType; + +import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; +import static java.nio.charset.StandardCharsets.UTF_8; + +public class Typekey { + + private static final String SCAN_SCOPE = "https://api.gluu.org/auth/scopes/scan.typekey"; + private static final Logger logger = LoggerFactory.getLogger(Typekey.class); + + private TypekeyConfiguration config; + + public Typekey() { + } + + public Typekey(TypekeyConfiguration config) { + this.config = config; + } + + private String buildServiceAuth() throws Exception { + String basic = config.getClientId() + ":" + config.getClientSecret(); + basic = new String(Base64.getEncoder().encode(basic.getBytes(UTF_8)), UTF_8); + + StringJoiner joiner = new StringJoiner("&"); + Map.of("grant_type", "client_credentials", "scope", URLEncoder.encode(SCAN_SCOPE, UTF_8)) + .forEach((k, v) -> joiner.add(k + "=" + v)); + + String asEndpoint = config.getAuthHost() + "/jans-auth/restv1/token"; + HTTPRequest request = new HTTPRequest(HTTPRequest.Method.POST, new URL(asEndpoint)); + + request.setAccept(APPLICATION_JSON); + request.setConnectTimeout(3000); + request.setReadTimeout(3000); + request.setQuery(joiner.toString()); + request.setAuthorization("Basic " + basic); + + HTTPResponse r = request.send(); + r.ensureStatusCode(200); + + logger.info("Got a token from {}", asEndpoint); + return "Bearer " + r.getContentAsJSONObject().getAsString("access_token"); + } + + private String signUid(String uid, String alias) throws Exception { + AuthCryptoProvider auth = new AuthCryptoProvider(config.getKeystoreName(), config.getKeystorePassword(), null); + String signedUid = auth.sign(uid, alias, null, SignatureAlgorithm.RS256); + return signedUid; + } + + public Map validateKeystrokes(String username, String k_data, String use_case) + throws Exception { + String token = buildServiceAuth(); + JSONArray k_data_array = new JSONArray(k_data); + int useCase = Integer.parseInt(use_case); + Map map = new HashMap(Map.of( + "k_data", k_data_array, + "uid", username, + "org_id", config.getOrgId(), + "use_case", useCase)); + String endpointUrl = config.getScanHost() + "/scan/typekey/validate"; + String message = new JSONObject(map).toString(); + HTTPRequest request = new HTTPRequest(HTTPRequest.Method.POST, new URL(endpointUrl)); + request.setContentType(APPLICATION_JSON); + request.setAccept(APPLICATION_JSON); + request.setConnectTimeout(3000); + request.setReadTimeout(3000); + request.setQuery(message); + request.setAuthorization(token); + HTTPResponse r = request.send(); + Map responseObject; + + if (r.getStatusCode() == 200) { + responseObject = r.getContentAsJSONObject(); + return responseObject; + } else { + int statusCode = r.getStatusCode(); + responseObject = new HashMap(); + switch (statusCode) { + case 401: + responseObject.put("status", "Unauthorized"); + break; + case 403: + responseObject.put("status", "Forbidden"); + break; + case 422: + responseObject.put("status", "Unprocessable entity"); + break; + case 400: + responseObject.put("status", "Bad request"); + break; + default: + responseObject.put("status", "Other error"); + logger.info("Other error. Status code: {}", statusCode); + break; + } + } + return responseObject; + } + + public void notifyKeystrokes(String uid, int track_id) { + String token = buildServiceAuth(); + Map map = new HashMap(Map.of( + "uid", uid, + "track_id", track_id, + "org_id", config.getOrgId(), + "use_case", 1)); + String endpointUrl = config.getScanHost() + "/scan/typekey/notify"; + String message = new JSONObject(map).toString(); + logger.info(message); + HTTPRequest request = new HTTPRequest(HTTPRequest.Method.POST, new URL(endpointUrl)); + request.setContentType(APPLICATION_JSON); + request.setAccept(APPLICATION_JSON); + request.setConnectTimeout(3000); + request.setReadTimeout(3000); + request.setQuery(message); + request.setAuthorization(token); + + HTTPResponse r = request.send(); + + r.ensureStatusCode(200); + logger.info("Notify sent successfully"); + } + + public String getRandomUseCase() { + Random rand = new Random(); + int result = rand.nextInt(config.getPhrases().size()) + 1; + return String.valueOf(result); + } + + public Map generateTypekeyData(String useCase) { + Map map = new HashMap(Map.of( + "phrase", config.getPhrases().get(useCase), + "useCase", useCase)); + return map; + } + + public boolean isEnrolling(int count) { + return count < 6; + } + +} From 631515e72842bccc7e58b15d91ecbf80355d9f4b Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Thu, 8 Feb 2024 09:29:08 -0600 Subject: [PATCH 11/38] feat: add IdentityProcessor.java --- .../gluu/agama/typekey/IdentityProcessor.java | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 lib/org/gluu/agama/typekey/IdentityProcessor.java diff --git a/lib/org/gluu/agama/typekey/IdentityProcessor.java b/lib/org/gluu/agama/typekey/IdentityProcessor.java new file mode 100644 index 0000000..ec0fe0f --- /dev/null +++ b/lib/org/gluu/agama/typekey/IdentityProcessor.java @@ -0,0 +1,120 @@ +package org.gluu.agama.typekey; + +import io.jans.as.common.model.common.User; +import io.jans.as.common.service.common.EncryptionService; +import io.jans.as.common.service.common.UserService; +import io.jans.orm.exception.operation.EntryNotFoundException; +import io.jans.service.cdi.util.CdiUtil; +import io.jans.as.server.service.AuthenticationService; +import io.jans.util.StringHelper; +import io.jans.orm.model.base.CustomObjectAttribute; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.type.TypeReference; + +public class IdentityProcessor implements IdentityProcessorInterface { + + private static final Logger logger = LoggerFactory.getLogger(IdentityProcessor.class); + + private static final String INUM_ATTR = "inum"; + private static final String EXT_ATTR = "jansExtUid"; + private static final String EXT_UID_PREFIX = "github:"; + + private static final String UID = "uid"; + private static final String MAIL = "mail"; + private static final String CN = "cn"; + private static final String DISPLAY_NAME = "displayName"; + private static final String GIVEN_NAME = "givenName"; + private static final String SN = "sn"; + + public IdentityProcessor() { + } + + public Map accountFromUsername(String username) { + + User user = getUser(UID, username); + boolean local = user != null; + logger.debug("There is {} local account for {}", local ? "a" : "no", username); + + if (local) { + String email = getSingleValuedAttr(user, MAIL); + String inum = getSingleValuedAttr(user, INUM_ATTR); + String name = getSingleValuedAttr(user, GIVEN_NAME); + + if (name == null) { + name = getSingleValuedAttr(user, DISPLAY_NAME); + + if (name == null) { + name = email.substring(0, email.indexOf("@")); + } + } + return Map.of(UID, username, INUM_ATTR, inum, "name", name, "email", email); + } + return Collections.emptyMap(); + } + + public boolean authenticate(String username, String password) { + AuthenticationService authenticationService = CdiUtil.bean(AuthenticationService.class); + logger.info("Validating {}", username); + boolean result = authenticationService.authenticate(username, password); + logger.info("Validation status is {}", result); + return result; + } + + public void enroll(String username, Map typekeyAttributes) { + User user = getUser(UID, username); + logger.info("Adding Typekey claims to UID {}", username); + UserService userService = CdiUtil.bean(UserService.class); + userService.addUserAttribute(user, "typekeyData", typekeyAttributes, false); + userService.updateUser(user); + } + + public boolean enrolled(String username) { + User user = getUser(UID, username); + UserService userService = CdiUtil.bean(UserService.class); + CustomObjectAttribute typekeyClaims = userService.getCustomAttribute(user, "typekeyData"); + if (typekeyClaims != null) { + logger.info("{} has enrolled", username); + return true; + } + logger.info("{} has not enrolled", username); + return false; + } + + public Map getTypekeyData(String username) { + User user = getUser(UID, username); + UserService userService = CdiUtil.bean(UserService.class); + CustomObjectAttribute typekeyClaims = userService.getCustomAttribute(user, "typekeyData"); + LinkedHashMap data = typekeyClaims.getValue(); + return data; + } + + private static User getUser(String attributeName, String value) { + UserService userService = CdiUtil.bean(UserService.class); + return userService.getUserByAttribute(attributeName, value, true); + } + + private static String getSingleValuedAttr(User user, String attribute) { + + Object value = null; + if (attribute.equals(UID)) { + // user.getAttribute("uid", true, false) always returns null :( + value = user.getUserId(); + } else { + value = user.getAttribute(attribute, true, false); + } + return value == null ? null : value.toString(); + + } + +} From 9fef10282a1b7ecc7fb6f2bac39a2d07fd6e1e81 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:12:25 -0600 Subject: [PATCH 12/38] feat: update project.json From a8404b648962e0c4d54a7e83831d063529a449a5 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:12:26 -0600 Subject: [PATCH 13/38] feat: update org.gluu.agama.typekey.json --- code/org.gluu.agama.typekey.json | 960 +++++++++++++++++++++++++++++-- 1 file changed, 915 insertions(+), 45 deletions(-) diff --git a/code/org.gluu.agama.typekey.json b/code/org.gluu.agama.typekey.json index 33206e4..d70377c 100644 --- a/code/org.gluu.agama.typekey.json +++ b/code/org.gluu.agama.typekey.json @@ -3,45 +3,673 @@ { "width": 170, "height": 123, - "id": "finish-02d289ca-d578-47b4-9d54-4adf3f52bc3b", + "id": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", "position": { - "x": 1931, - "y": 30 + "x": 3576.7353459243327, + "y": 313.7754225937342 }, "type": "finish", "data": { - "id": "finish-02d289ca-d578-47b4-9d54-4adf3f52bc3b", + "id": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", "type": "Agama-finish-Flow", - "parentId": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "parentId": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "handles": [], + "position": { + "x": 3576.7353459243327, + "y": 313.7754225937342 + }, + "agamaData": { + "id": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", + "parentId": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasComment": true, + "comment": "", + "flowfilename": "", + "returnVariable": "{userId: user.username}", + "nodeIcon": "material-symbols:line-end-square-rounded", + "displayName": "Finish success" + } + }, + "selected": true, + "dragging": false, + "positionAbsolute": { + "x": 3576.7353459243327, + "y": 313.7754225937342 + } + }, + { + "width": 170, + "height": 123, + "id": "finish-b284b72d-35e3-4736-ae24-46871f3ea706", + "position": { + "x": 3000.5745771838574, + "y": -255.37966319081934 + }, + "type": "finish", + "data": { + "id": "finish-b284b72d-35e3-4736-ae24-46871f3ea706", + "type": "Agama-finish-Flow", + "parentId": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", "whenCondition": "WhenFalse", "inRepeatBlock": false, + "inIterateBlock": false, "handles": [ - "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.FAILURE", - "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.SUCCESS" + "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.FAILURE", + "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.SUCCESS" + ], + "position": { + "x": 3000.5745771838574, + "y": -255.37966319081934 + }, + "agamaData": { + "id": "finish-b284b72d-35e3-4736-ae24-46871f3ea706", + "parentId": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasComment": true, + "comment": "", + "flowfilename": "", + "returnVariable": "{userId:user.username}", + "nodeIcon": "material-symbols:line-end-square-rounded" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 3000.5745771838574, + "y": -255.37966319081934 + } + }, + { + "width": 170, + "height": 123, + "id": "finish-ac3f4474-4e43-481b-a8a5-f1731a107c89", + "position": { + "x": 3513.7353459243327, + "y": 29.77542259373422 + }, + "type": "finish", + "data": { + "id": "finish-ac3f4474-4e43-481b-a8a5-f1731a107c89", + "type": "Agama-finish-Flow", + "parentId": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "handles": [ + "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80.FAILURE", + "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80.SUCCESS" ], "position": { - "x": 1931, - "y": 30 + "x": 3513.7353459243327, + "y": 29.77542259373422 + }, + "agamaData": { + "id": "finish-ac3f4474-4e43-481b-a8a5-f1731a107c89", + "parentId": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasComment": true, + "comment": "", + "flowfilename": "", + "returnVariable": "Authentication failed", + "finishMode": "withFailure", + "nodeIcon": "material-symbols:line-end-square-rounded" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 3513.7353459243327, + "y": 29.77542259373422 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", + "position": { + "x": 3376.7353459243327, + "y": 313.7754225937342 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", + "type": "Agama-call-Node", + "parentId": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 3376.7353459243327, + "y": 313.7754225937342 + }, + "agamaData": { + "id": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", + "parentId": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80", + "type": "Agama-call-Node", + "displayName": "", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "notifyKeystrokes", + "javaVariableName": "tk", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "inIterateBlock": false, + "arguments": [ + "user.username", + "typekey_result.track_id" + ], + "nodeIcon": "material-symbols:code", + "hasSuccess": "", + "hasFailure": "", + "hasNoRepeat": false, + "hasRepeat": false + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 3376.7353459243327, + "y": 313.7754225937342 + } + }, + { + "width": 210, + "height": 140, + "id": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80", + "position": { + "x": 3263.7353459243327, + "y": 83.77542259373422 + }, + "parentId": "Agama-call-Node-c2f3dd23-937e-4655-8cb4-98bd4dcf18f3", + "type": "when", + "data": { + "id": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80", + "type": "Agama-when-Node", + "parentId": "Agama-call-Node-c2f3dd23-937e-4655-8cb4-98bd4dcf18f3", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 3263.7353459243327, + "y": 83.77542259373422 + }, + "agamaData": { + "id": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80", + "parentId": "Agama-call-Node-c2f3dd23-937e-4655-8cb4-98bd4dcf18f3", + "type": "Agama-when-Node", + "conditions": [ + { + "variable": "authenticated", + "operator": "is", + "dataValue": "true", + "combinator": "none" + } + ], + "hasComment": true, + "inRepeatBlock": false, + "hasSuccess": "", + "hasFailure": "", + "hasNoRepeat": false, + "hasRepeat": false + }, + "handles": [ + "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80.FAILURE", + "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80.SUCCESS" + ] + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 3263.7353459243327, + "y": 83.77542259373422 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-c2f3dd23-937e-4655-8cb4-98bd4dcf18f3", + "position": { + "x": 3053.3395738633503, + "y": 26.310165240073445 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-c2f3dd23-937e-4655-8cb4-98bd4dcf18f3", + "type": "Agama-call-Node", + "parentId": "Agama-rrf-Node-036fd006-9b76-41e1-9e84-d9d6aa449b1b", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 3053.3395738633503, + "y": 26.310165240073445 + }, + "agamaData": { + "id": "Agama-call-Node-c2f3dd23-937e-4655-8cb4-98bd4dcf18f3", + "parentId": "Agama-rrf-Node-036fd006-9b76-41e1-9e84-d9d6aa449b1b", + "type": "Agama-call-Node", + "displayName": "Authenticate username/pw", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "authenticate", + "javaVariableName": "idp", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "arguments": [ + "user.username", + "password.pwd" + ], + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "authenticated" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 3053.3395738633503, + "y": 26.310165240073445 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-rrf-Node-036fd006-9b76-41e1-9e84-d9d6aa449b1b", + "position": { + "x": 2856.135721642325, + "y": 25.215648024529685 + }, + "type": "rrf", + "data": { + "id": "Agama-rrf-Node-036fd006-9b76-41e1-9e84-d9d6aa449b1b", + "type": "Agama-rrf-Node", + "parentId": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 2856.135721642325, + "y": 25.215648024529685 + }, + "agamaData": { + "id": "Agama-rrf-Node-036fd006-9b76-41e1-9e84-d9d6aa449b1b", + "parentId": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "type": "Agama-rrf-Node", + "displayName": "Get password", + "hasComment": true, + "comment": "", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "inIterateBlock": false, + "assignments": [], + "nodeIcon": "ph:globe-simple", + "templatePath": "typekey/password.ftlh", + "asssignedVariableName": "password" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2856.135721642325, + "y": 25.215648024529685 + } + }, + { + "width": 210, + "height": 140, + "id": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "position": { + "x": 2749.4194913993038, + "y": -200.22457740626575 + }, + "parentId": "Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2", + "type": "when", + "data": { + "id": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "type": "Agama-when-Node", + "parentId": "Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 2749.4194913993038, + "y": -200.22457740626575 + }, + "agamaData": { + "id": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "parentId": "Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2", + "type": "Agama-when-Node", + "conditions": [ + { + "variable": "typekey_result.status", + "operator": "is", + "dataValue": "\"Enrollment\"", + "combinator": "none" + } + ], + "hasComment": true, + "inRepeatBlock": false + }, + "handles": [ + "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.FAILURE", + "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.SUCCESS" + ] + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2749.4194913993038, + "y": -200.22457740626575 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2", + "position": { + "x": 2550.7353459243327, + "y": -254.22457740626578 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2", + "type": "Agama-call-Node", + "parentId": "Agama-rrf-Node-9316abda-c5e8-4cc6-a2f7-68eb2faf3e7b", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 2550.7353459243327, + "y": -254.22457740626578 + }, + "agamaData": { + "id": "Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2", + "parentId": "Agama-rrf-Node-9316abda-c5e8-4cc6-a2f7-68eb2faf3e7b", + "type": "Agama-call-Node", + "displayName": "Call validate", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "validateKeystrokes", + "javaVariableName": "tk", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "arguments": [ + "user.username", + "phraseData.phrase_data", + "use_case" + ], + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "typekey_result" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2550.7353459243327, + "y": -254.22457740626578 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-rrf-Node-9316abda-c5e8-4cc6-a2f7-68eb2faf3e7b", + "position": { + "x": 2350.7353459243327, + "y": -254.22457740626578 + }, + "type": "rrf", + "data": { + "id": "Agama-rrf-Node-9316abda-c5e8-4cc6-a2f7-68eb2faf3e7b", + "type": "Agama-rrf-Node", + "parentId": "Agama-assignment-Node-0d0b06ba-3a17-47a4-9d3c-317b81769c8e", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 2350.7353459243327, + "y": -254.22457740626578 + }, + "agamaData": { + "id": "Agama-rrf-Node-9316abda-c5e8-4cc6-a2f7-68eb2faf3e7b", + "parentId": "Agama-assignment-Node-0d0b06ba-3a17-47a4-9d3c-317b81769c8e", + "type": "Agama-rrf-Node", + "displayName": "Get keystroke data", + "hasComment": true, + "comment": "", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "assignments": [], + "nodeIcon": "ph:globe-simple", + "templatePath": "typekey/phrase.ftlh", + "asssignedVariableName": "phraseData", + "arguments": "phraseDict" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2350.7353459243327, + "y": -254.22457740626578 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-assignment-Node-0d0b06ba-3a17-47a4-9d3c-317b81769c8e", + "position": { + "x": 2150.7353459243327, + "y": -254.22457740626578 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-0d0b06ba-3a17-47a4-9d3c-317b81769c8e", + "type": "Agama-assignment-Node", + "parentId": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 2150.7353459243327, + "y": -254.22457740626578 + }, + "agamaData": { + "id": "Agama-assignment-Node-0d0b06ba-3a17-47a4-9d3c-317b81769c8e", + "parentId": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", + "type": "Agama-assignment-Node", + "displayName": "Phrase dict", + "hasComment": true, + "comment": "", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "{phrase:phrase}", + "assignedVariableName": "phraseDict" + } + ], + "nodeIcon": "material-symbols:equal" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2150.7353459243327, + "y": -254.22457740626578 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-assignment-Node-ad0f2d62-bf6d-43a0-a30e-e6d6d77965e3", + "position": { + "x": 2213.7353459243327, + "y": 29.77542259373422 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-ad0f2d62-bf6d-43a0-a30e-e6d6d77965e3", + "type": "Agama-assignment-Node", + "parentId": "Agama-call-Node-b7aea152-adae-4950-9c00-2502fed74f81", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 2213.7353459243327, + "y": 29.77542259373422 + }, + "agamaData": { + "id": "Agama-assignment-Node-ad0f2d62-bf6d-43a0-a30e-e6d6d77965e3", + "parentId": "Agama-call-Node-b7aea152-adae-4950-9c00-2502fed74f81", + "type": "Agama-assignment-Node", + "displayName": "Variables for use", + "hasComment": true, + "comment": "", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "typekey_data.phrase", + "assignedVariableName": "phrase" + }, + { + "variableTypeCheck": false, + "assignmentExpression": "typekey_data.useCase", + "assignedVariableName": "use_case" + } + ], + "nodeIcon": "material-symbols:equal" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2213.7353459243327, + "y": 29.77542259373422 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-b7aea152-adae-4950-9c00-2502fed74f81", + "position": { + "x": 2013.7353459243327, + "y": 29.77542259373422 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-b7aea152-adae-4950-9c00-2502fed74f81", + "type": "Agama-call-Node", + "parentId": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 2013.7353459243327, + "y": 29.77542259373422 + }, + "agamaData": { + "id": "Agama-call-Node-b7aea152-adae-4950-9c00-2502fed74f81", + "parentId": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", + "type": "Agama-call-Node", + "displayName": "Retrieve enrollment", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "getTypekeyData", + "javaVariableName": "idp", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "inIterateBlock": false, + "arguments": [ + "user.username" + ], + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "typekey_data", + "hasSuccess": "", + "hasFailure": "", + "hasNoRepeat": false, + "hasRepeat": false + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2013.7353459243327, + "y": 29.77542259373422 + } + }, + { + "width": 210, + "height": 140, + "id": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", + "position": { + "x": 1900.7353459243327, + "y": -200.22457740626578 + }, + "parentId": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "type": "when", + "data": { + "id": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", + "type": "Agama-when-Node", + "parentId": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 1900.7353459243327, + "y": -200.22457740626578 }, "agamaData": { - "id": "finish-02d289ca-d578-47b4-9d54-4adf3f52bc3b", + "id": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", "parentId": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", - "type": "Agama-finish-Flow", - "hasSuccess": false, - "hasFailure": false, + "type": "Agama-when-Node", + "conditions": [ + { + "variable": "enrolled", + "operator": "is", + "dataValue": "true", + "combinator": "none" + } + ], "hasComment": true, - "comment": "", - "flowfilename": "", - "returnVariable": "{ userId: \"as9233Qz\", property1: \"value1\"}", - "finishMode": "withSuccess", - "nodeIcon": "material-symbols:line-end-square-rounded" - } + "inRepeatBlock": false + }, + "handles": [ + "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b.FAILURE", + "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b.SUCCESS" + ] }, - "selected": true, + "selected": false, "dragging": false, "positionAbsolute": { - "x": 1931, - "y": 30 + "x": 1900.7353459243327, + "y": -200.22457740626578 } }, { @@ -85,7 +713,8 @@ } ], "nodeIcon": "material-symbols:equal" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -133,7 +762,8 @@ ], "nodeIcon": "material-symbols:code", "asssignedVariableName": "dummy" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -180,7 +810,8 @@ ], "nodeIcon": "material-symbols:code", "asssignedVariableName": "phrase_map" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -225,7 +856,8 @@ "arguments": [], "nodeIcon": "material-symbols:code", "asssignedVariableName": "random_usecase" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -240,7 +872,7 @@ "id": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", "position": { "x": 1681, - "y": 84 + "y": 82.68414547497099 }, "parentId": "Agama-call-Node-a80c7da7-ec9d-473f-8d94-3738b778d437", "type": "when", @@ -252,7 +884,7 @@ "inRepeatBlock": false, "position": { "x": 1681, - "y": 84 + "y": 82.68414547497099 }, "agamaData": { "id": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", @@ -268,19 +900,22 @@ ], "hasComment": true, "inRepeatBlock": false, - "hasSuccess": true, - "hasFailure": true + "hasSuccess": "", + "hasFailure": "", + "hasNoRepeat": false, + "hasRepeat": false }, "handles": [ "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.FAILURE", "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.SUCCESS" - ] + ], + "skake": false }, "selected": false, "dragging": false, "positionAbsolute": { "x": 1681, - "y": 84 + "y": 82.68414547497099 } }, { @@ -319,7 +954,8 @@ "arguments": "user.username", "nodeIcon": "material-symbols:code", "asssignedVariableName": "enrolled" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -364,7 +1000,8 @@ "finishMode": "withFailure", "nodeIcon": "material-symbols:line-end-square-rounded", "displayName": "User not found" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -413,7 +1050,8 @@ "handles": [ "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14.FAILURE", "Agama-when-Node-87a6f911-acd4-4772-a205-f3e52f5f3d14.SUCCESS" - ] + ], + "skake": false }, "selected": false, "dragging": false, @@ -458,7 +1096,8 @@ "arguments": "user.username", "nodeIcon": "material-symbols:code", "asssignedVariableName": "userData" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -499,7 +1138,8 @@ "nodeIcon": "ph:globe-simple", "templatePath": "typekey/username.ftlh", "asssignedVariableName": "user" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -544,7 +1184,8 @@ "arguments": "conf", "nodeIcon": "material-symbols:code", "asssignedVariableName": "tk" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -589,7 +1230,8 @@ "arguments": "", "nodeIcon": "material-symbols:code", "asssignedVariableName": "idp" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -633,7 +1275,8 @@ "hasFailure": "", "hasNoRepeat": false, "hasRepeat": false - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -915,10 +1558,10 @@ } }, { - "id": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49-finish-02d289ca-d578-47b4-9d54-4adf3f52bc3b-a599e35f-404d-4644-9b2f-a265230862f1", + "id": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49-Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b-dca431e4-5cb4-48f0-88a6-5fa15d58a40a", "type": "straight", "source": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", - "target": "finish-02d289ca-d578-47b4-9d54-4adf3f52bc3b", + "target": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", "label": "", "labelBgPadding": [ 8, @@ -931,11 +1574,238 @@ "fillOpacity": 0.7 }, "sourceHandle": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49.FAILURE" + }, + { + "id": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b-Agama-call-Node-b7aea152-adae-4950-9c00-2502fed74f81-9db78315-53db-4ac2-9133-c95c39561d52", + "type": "straight", + "source": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", + "target": "Agama-call-Node-b7aea152-adae-4950-9c00-2502fed74f81", + "label": "Condition met", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b.SUCCESS" + }, + { + "id": "Agama-call-Node-b7aea152-adae-4950-9c00-2502fed74f81-Agama-assignment-Node-ad0f2d62-bf6d-43a0-a30e-e6d6d77965e3-20998e8a-de0e-4f39-8ba1-23745ab4716b", + "type": "straight", + "source": "Agama-call-Node-b7aea152-adae-4950-9c00-2502fed74f81", + "target": "Agama-assignment-Node-ad0f2d62-bf6d-43a0-a30e-e6d6d77965e3", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b-Agama-assignment-Node-0d0b06ba-3a17-47a4-9d3c-317b81769c8e-a40377ce-e740-4d2c-b267-a10c69fdaa1f", + "type": "straight", + "source": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", + "target": "Agama-assignment-Node-0d0b06ba-3a17-47a4-9d3c-317b81769c8e", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b.FAILURE" + }, + { + "id": "Agama-assignment-Node-0d0b06ba-3a17-47a4-9d3c-317b81769c8e-Agama-rrf-Node-9316abda-c5e8-4cc6-a2f7-68eb2faf3e7b-f1f5d99e-85ef-488b-b412-53e05bd0dc05", + "type": "straight", + "source": "Agama-assignment-Node-0d0b06ba-3a17-47a4-9d3c-317b81769c8e", + "target": "Agama-rrf-Node-9316abda-c5e8-4cc6-a2f7-68eb2faf3e7b", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-rrf-Node-9316abda-c5e8-4cc6-a2f7-68eb2faf3e7b-Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2-d49ff3b2-4455-45c1-b5a9-556ca4553fdd", + "type": "straight", + "source": "Agama-rrf-Node-9316abda-c5e8-4cc6-a2f7-68eb2faf3e7b", + "target": "Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2-Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f-066a9aa3-201d-45a8-8871-9d3d99200d75", + "type": "straight", + "source": "Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2", + "target": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f-Agama-rrf-Node-036fd006-9b76-41e1-9e84-d9d6aa449b1b-a6b29cf1-57b3-4db0-a43e-6b6602494f94", + "type": "straight", + "source": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "target": "Agama-rrf-Node-036fd006-9b76-41e1-9e84-d9d6aa449b1b", + "label": "Condition met", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.SUCCESS" + }, + { + "id": "Agama-rrf-Node-036fd006-9b76-41e1-9e84-d9d6aa449b1b-Agama-call-Node-c2f3dd23-937e-4655-8cb4-98bd4dcf18f3-cf294535-a869-4146-8dd8-c56b5effac73", + "type": "straight", + "source": "Agama-rrf-Node-036fd006-9b76-41e1-9e84-d9d6aa449b1b", + "target": "Agama-call-Node-c2f3dd23-937e-4655-8cb4-98bd4dcf18f3", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-c2f3dd23-937e-4655-8cb4-98bd4dcf18f3-Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80-f1aedd36-423d-444f-bee7-05e14c642710", + "type": "straight", + "source": "Agama-call-Node-c2f3dd23-937e-4655-8cb4-98bd4dcf18f3", + "target": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80-Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32-feef91a6-4497-46b5-a424-a5c27ccebbd3", + "type": "straight", + "source": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80", + "target": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", + "label": "Condition met", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80.SUCCESS" + }, + { + "id": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80-finish-ac3f4474-4e43-481b-a8a5-f1731a107c89-eddc37b9-7d2b-4c39-8900-a8a528dea9be", + "type": "straight", + "source": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80", + "target": "finish-ac3f4474-4e43-481b-a8a5-f1731a107c89", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80.FAILURE" + }, + { + "id": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f-finish-b284b72d-35e3-4736-ae24-46871f3ea706-78ccaa62-758e-4e6c-a872-83678c201e90", + "type": "straight", + "source": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "target": "finish-b284b72d-35e3-4736-ae24-46871f3ea706", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.FAILURE" + }, + { + "id": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32-finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4-a98ca210-aae0-4e37-a8d6-5596cb2ec1ce", + "type": "straight", + "source": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", + "target": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } } ], "viewport": { - "x": -1699, - "y": 5, - "zoom": 1 + "x": -2430.932324399947, + "y": 91.14387461625302, + "zoom": 0.8657365655196583 } } \ No newline at end of file From 5a5cfecb97b77ab3469343b4b61c4dcc688d5748 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:12:27 -0600 Subject: [PATCH 14/38] feat: update org.gluu.agama.typekey.flow --- code/org.gluu.agama.typekey.flow | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/code/org.gluu.agama.typekey.flow b/code/org.gluu.agama.typekey.flow index 5ac966f..a3c0eb9 100644 --- a/code/org.gluu.agama.typekey.flow +++ b/code/org.gluu.agama.typekey.flow @@ -6,8 +6,8 @@ tk = Call org.gluu.agama.typekey.Typekey#new conf user = RRF "typekey/username.ftlh" userData = Call idp accountFromUsername user.username When userData.empty is true - it_wzqox = {success:false, error: "User not found"} - Finish it_wzqox + it_orwks = {success:false, error: "User not found"} + Finish it_orwks enrolled = Call idp enrolled user.username When enrolled is false random_usecase = Call tk getRandomUseCase @@ -15,5 +15,21 @@ When enrolled is false dummy = Call idp enroll user.username phrase_map phrase = phrase_map.phrase use_case = random_usecase -it_taewl = {success:true, data: { userId: "as9233Qz", property1: "value1"}} -Finish it_taewl \ No newline at end of file +When enrolled is true + typekey_data = Call idp getTypekeyData user.username + phrase = typekey_data.phrase + use_case = typekey_data.useCase +phraseDict = {phrase:phrase} +phraseData = RRF "typekey/phrase.ftlh" phraseDict +typekey_result = Call tk validateKeystrokes user.username phraseData.phrase_data use_case +When typekey_result.status is "Enrollment" + password = RRF "typekey/password.ftlh" + authenticated = Call idp authenticate user.username password.pwd + When authenticated is true + Call tk notifyKeystrokes user.username typekey_result.track_id + it_jqepp = undefined + Finish it_jqepp + it_fmlpt = {success:false, error: "Authentication failed"} + Finish it_fmlpt +it_xytnt = undefined +Finish it_xytnt \ No newline at end of file From 76edace0b80207c67f048e4bbfcc0c01fd5982e6 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:31:01 -0600 Subject: [PATCH 15/38] feat: update project.json From 9b42443a695da990b4937426d760b5f04ae38abe Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:31:02 -0600 Subject: [PATCH 16/38] feat: update org.gluu.agama.typekey.json --- code/org.gluu.agama.typekey.json | 60 ++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/code/org.gluu.agama.typekey.json b/code/org.gluu.agama.typekey.json index d70377c..5788f97 100644 --- a/code/org.gluu.agama.typekey.json +++ b/code/org.gluu.agama.typekey.json @@ -30,12 +30,14 @@ "hasComment": true, "comment": "", "flowfilename": "", - "returnVariable": "{userId: user.username}", + "returnVariable": "{ userId: user.username}", "nodeIcon": "material-symbols:line-end-square-rounded", - "displayName": "Finish success" - } + "displayName": "Finish success", + "finishMode": "withSuccess" + }, + "skake": false }, - "selected": true, + "selected": false, "dragging": false, "positionAbsolute": { "x": 3576.7353459243327, @@ -77,9 +79,10 @@ "flowfilename": "", "returnVariable": "{userId:user.username}", "nodeIcon": "material-symbols:line-end-square-rounded" - } + }, + "skake": false }, - "selected": false, + "selected": true, "dragging": false, "positionAbsolute": { "x": 3000.5745771838574, @@ -121,8 +124,10 @@ "flowfilename": "", "returnVariable": "Authentication failed", "finishMode": "withFailure", - "nodeIcon": "material-symbols:line-end-square-rounded" - } + "nodeIcon": "material-symbols:line-end-square-rounded", + "displayName": "Finish failed" + }, + "skake": false }, "selected": false, "dragging": false, @@ -175,7 +180,8 @@ "hasFailure": "", "hasNoRepeat": false, "hasRepeat": false - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -227,7 +233,8 @@ "handles": [ "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80.FAILURE", "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80.SUCCESS" - ] + ], + "skake": false }, "selected": false, "dragging": false, @@ -277,7 +284,8 @@ ], "nodeIcon": "material-symbols:code", "asssignedVariableName": "authenticated" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -320,7 +328,8 @@ "nodeIcon": "ph:globe-simple", "templatePath": "typekey/password.ftlh", "asssignedVariableName": "password" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -368,7 +377,8 @@ "handles": [ "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.FAILURE", "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.SUCCESS" - ] + ], + "skake": false }, "selected": false, "dragging": false, @@ -419,7 +429,8 @@ ], "nodeIcon": "material-symbols:code", "asssignedVariableName": "typekey_result" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -463,7 +474,8 @@ "templatePath": "typekey/phrase.ftlh", "asssignedVariableName": "phraseData", "arguments": "phraseDict" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -510,7 +522,8 @@ } ], "nodeIcon": "material-symbols:equal" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -562,7 +575,8 @@ } ], "nodeIcon": "material-symbols:equal" - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -615,7 +629,8 @@ "hasFailure": "", "hasNoRepeat": false, "hasRepeat": false - } + }, + "skake": false }, "selected": false, "dragging": false, @@ -663,7 +678,8 @@ "handles": [ "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b.FAILURE", "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b.SUCCESS" - ] + ], + "skake": false }, "selected": false, "dragging": false, @@ -1804,8 +1820,8 @@ } ], "viewport": { - "x": -2430.932324399947, - "y": 91.14387461625302, - "zoom": 0.8657365655196583 + "x": -868.732619098997, + "y": 285.83665122748664, + "zoom": 0.5 } } \ No newline at end of file From 75579909c590bdcd5016cf503f0e67acacdcb945 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:31:03 -0600 Subject: [PATCH 17/38] feat: update org.gluu.agama.typekey.flow --- code/org.gluu.agama.typekey.flow | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/org.gluu.agama.typekey.flow b/code/org.gluu.agama.typekey.flow index a3c0eb9..4318f15 100644 --- a/code/org.gluu.agama.typekey.flow +++ b/code/org.gluu.agama.typekey.flow @@ -6,8 +6,8 @@ tk = Call org.gluu.agama.typekey.Typekey#new conf user = RRF "typekey/username.ftlh" userData = Call idp accountFromUsername user.username When userData.empty is true - it_orwks = {success:false, error: "User not found"} - Finish it_orwks + it_kjmim = {success:false, error: "User not found"} + Finish it_kjmim enrolled = Call idp enrolled user.username When enrolled is false random_usecase = Call tk getRandomUseCase @@ -27,9 +27,9 @@ When typekey_result.status is "Enrollment" authenticated = Call idp authenticate user.username password.pwd When authenticated is true Call tk notifyKeystrokes user.username typekey_result.track_id - it_jqepp = undefined - Finish it_jqepp - it_fmlpt = {success:false, error: "Authentication failed"} - Finish it_fmlpt -it_xytnt = undefined -Finish it_xytnt \ No newline at end of file + it_doecp = {success:true, data: { userId: user.username}} + Finish it_doecp + it_gklkx = {success:false, error: "Authentication failed"} + Finish it_gklkx +it_himhi = undefined +Finish it_himhi \ No newline at end of file From ab4d933bdd14d71651d9193a7c8aa258790dd420 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:25:20 -0600 Subject: [PATCH 18/38] feat: update project.json From 6ab5849d79ee374bb145f5e9ca8a86bc2ae12012 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:25:21 -0600 Subject: [PATCH 19/38] feat: update org.gluu.agama.typekey.json --- code/org.gluu.agama.typekey.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/org.gluu.agama.typekey.json b/code/org.gluu.agama.typekey.json index 5788f97..c8e32bc 100644 --- a/code/org.gluu.agama.typekey.json +++ b/code/org.gluu.agama.typekey.json @@ -49,8 +49,8 @@ "height": 123, "id": "finish-b284b72d-35e3-4736-ae24-46871f3ea706", "position": { - "x": 3000.5745771838574, - "y": -255.37966319081934 + "x": 3010.5745771838574, + "y": -253.37966319081931 }, "type": "finish", "data": { @@ -65,8 +65,8 @@ "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.SUCCESS" ], "position": { - "x": 3000.5745771838574, - "y": -255.37966319081934 + "x": 3010.5745771838574, + "y": -253.37966319081931 }, "agamaData": { "id": "finish-b284b72d-35e3-4736-ae24-46871f3ea706", @@ -85,8 +85,8 @@ "selected": true, "dragging": false, "positionAbsolute": { - "x": 3000.5745771838574, - "y": -255.37966319081934 + "x": 3010.5745771838574, + "y": -253.37966319081931 } }, { @@ -1820,8 +1820,8 @@ } ], "viewport": { - "x": -868.732619098997, - "y": 285.83665122748664, + "x": -649.350938239168, + "y": 206.4600791365021, "zoom": 0.5 } } \ No newline at end of file From ac8e5e690c99d499e5418b26957b13a6218efb97 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:25:22 -0600 Subject: [PATCH 20/38] feat: update org.gluu.agama.typekey.flow --- code/org.gluu.agama.typekey.flow | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/org.gluu.agama.typekey.flow b/code/org.gluu.agama.typekey.flow index 4318f15..d928e64 100644 --- a/code/org.gluu.agama.typekey.flow +++ b/code/org.gluu.agama.typekey.flow @@ -6,8 +6,8 @@ tk = Call org.gluu.agama.typekey.Typekey#new conf user = RRF "typekey/username.ftlh" userData = Call idp accountFromUsername user.username When userData.empty is true - it_kjmim = {success:false, error: "User not found"} - Finish it_kjmim + it_lkfpn = {success:false, error: "User not found"} + Finish it_lkfpn enrolled = Call idp enrolled user.username When enrolled is false random_usecase = Call tk getRandomUseCase @@ -27,9 +27,9 @@ When typekey_result.status is "Enrollment" authenticated = Call idp authenticate user.username password.pwd When authenticated is true Call tk notifyKeystrokes user.username typekey_result.track_id - it_doecp = {success:true, data: { userId: user.username}} - Finish it_doecp - it_gklkx = {success:false, error: "Authentication failed"} - Finish it_gklkx -it_himhi = undefined -Finish it_himhi \ No newline at end of file + it_bnrfu = {success:true, data: { userId: user.username}} + Finish it_bnrfu + it_vvrqr = {success:false, error: "Authentication failed"} + Finish it_vvrqr +it_jtrjb = undefined +Finish it_jtrjb \ No newline at end of file From 02903071f8db3765291b03d25d8816b22c2f079e Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Mon, 19 Feb 2024 09:30:39 -0600 Subject: [PATCH 21/38] feat: update README.md --- README.md | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) diff --git a/README.md b/README.md index ef9a38d..bd574ba 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,164 @@ +# Agama Passkey Project + + +[![Contributors][contributors-shield]][contributors-url] +[![Forks][forks-shield]][forks-url] +[![Stargazers][stars-shield]][stars-url] +[![Issues][issues-shield]][issues-url] +[![Apache License][license-shield]][license-url] + +Use this project to authenticate using security devices (Android Touch, iOS Face Id, Yubico Key, Windows Hello, Touch ID on Mac, etc.) + +## How it works at a glance + +When a main flow of this project is launched (namely `org.gluu.agama.passkey.main`) the user's browser is +redirected to a view where he/she must first enter your username and password, then show a list of passkeys that you have +registered, in case you do not have one you must register one, once you have registered your passkey you can complete +the authentication step with passkey. +But you can also log in from the initial screen without entering a c redential. + +## Project Deployment + +To deploy this project we need to meet the requirements. + +### Requirements + +1. Running instance of `Jans Auth Server`, `Jans Fido2`, `Jans Casa` and `Jans Scim` + +### Add Java dependencies + +1. Download + latest [agama-passkey-custom.jar](https://github.com/GluuFederation/agama-passkey/releases/latest/download/agama-passkey-custom.jar) + from [Releases](https://github.com/GluuFederation/agama-passkey/releases) +2. `scp` the jar file to `/opt/jans/jetty/jans-auth/custom/libs/` on Auth Server +3. On Auth Server, edit `/opt/jans/jetty/jans-auth/webapps/jans-auth.xml` and + add the jar file to the `...` element. For example: + +``` + + /jans-auth + + /jans-auth.war + + true + + ... + /opt/jans/jetty/jans-auth/custom/libs/agama-passkey-custom.jar, + ... + + +``` + +4. Restart Auth Server to load the new jar: + +``` +systemctl restart jans-auth +```` + +### Deployment + +Download the +latest [agama-passkey.gama](https://github.com/GluuFederation/agama-passkey/releases/latest/download/agama-passkey.gama) +file and deploy it in Auth Sever. + +Follow the steps below: + +- Copy (SCP/SFTP) the gama file of this project to a location in your `Jans Server` +- Connect (SSH) to your `Jans Server` and open TUI: `python3 /opt/jans/jans-cli/jans_cli_tui.py` +- Navigate to the `Agama` tab and then select `"Upload project"`. Choose the gama file +- Wait for about one minute and then select the row in the table corresponding to this project +- Press `d` and ensure there were not deployment errors +- Pres `ESC` to close the dialog + +![TUI_AGAMA_DEPLOY](https://github.com/GluuFederation/agama-passkey/assets/86965029/1d6b8cab-ddad-451c-b620-d19be1b7f9e3) + +### Configure Jans Scim + +- Once we have deployed the `agama project`, we need to configure the `jans scim` parameters, then we proceed to create a new user `jans scim` with scope `https://jans.io/scim/fido2.read` and `https://jans.io/scim/fido2.write`. +- Now that we have the jans scim client, we proceed to configure this client using TUI. +- We open TUI and we are located in agama, we select in the table where our application is deployed and press `c`, this will open a configuration panel, where we must first hit `Export Sample Config` and save the file in some path. +- Now we go to the exported file and edit it and enter the credentials + +``` +{ + "org.gluu.agama.passkey.add": {}, + "org.gluu.agama.passkey.nickname": {}, + "org.gluu.agama.passkey.list": {}, + "org.gluu.agama.passkey.main": { + "scimClientId": "YOUR_SCIM_CLIENT_ID", + "scimClientSecret": "YOUR_SCIM_CLIENT_SECRET" + } +} +``` + +- We go back to the TUI and click on `Import Configuration` and select the modified configuration file with our parameters. +- With this, our `agama project` is now configured and we can start testing. + +![TUI_SCIM_CONFIGURATION](https://github.com/GluuFederation/agama-passkey/assets/86965029/404b066e-a6f3-4c1e-9bf8-afe3f63121e7) + +## Testing + +You'll need an OpenID Connect test RP. You can try [oidcdebugger](https://oidcdebugger.com/), +[jans-tarp](https://github.com/JanssenProject/jans/tree/main/demos/jans-tarp) +or [jans-tent](https://github.com/JanssenProject/jans/tree/main/demos/jans-tent). Check out this video to see an example +of **agama-passkey** in action: + +### Use case 1: + +Login with credentials and configure your first passkey device and as a last step complete the login with your new configured key. + +![TEST_USE_CASE_1](https://github.com/GluuFederation/agama-passkey/assets/86965029/0e5cc346-a576-499a-a9e3-6069d6932a4b) + +### Use case 2: + +Log in without credentials, use the `Login with passkey` button. + + +![TEST_USE_CASE_2](https://github.com/GluuFederation/agama-passkey/assets/86965029/200328ec-888a-4767-8242-1c50a126a979) + +# Contributors + + + + + +
+ + Milton +
+ Milton Ch. +
+
+ +# License + +This project is licensed under the [Apache 2.0](https://github.com/GluuFederation/agama-security-key/blob/main/LICENSE) + + + +[contributors-shield]: https://img.shields.io/github/contributors/GluuFederation/agama-passkey.svg?style=for-the-badge + +[contributors-url]: https://github.com/GluuFederation/agama-passkey/graphs/contributors + +[forks-shield]: https://img.shields.io/github/forks/GluuFederation/agama-passkey.svg?style=for-the-badge + +[forks-url]: https://github.com/GluuFederation/agama-passkey/network/members + +[stars-shield]: https://img.shields.io/github/stars/GluuFederation/agama-passkey?style=for-the-badge + +[stars-url]: https://github.com/GluuFederation/agama-passkey/stargazers + +[issues-shield]: https://img.shields.io/github/issues/GluuFederation/agama-passkey.svg?style=for-the-badge + +[issues-url]: https://github.com/GluuFederation/agama-passkey/issues + +[license-shield]: https://img.shields.io/github/license/GluuFederation/agama-passkey.svg?style=for-the-badge + +[license-url]: https://github.com/GluuFederation/agama-passkey/blob/main/LICENSE + + + + # agama-typekey An Agama flow designed to authenticate against the Typekey API to test behavioral metrics From b449411233be0649a22ee0d8302d23ce6f490daa Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Mon, 19 Feb 2024 09:35:16 -0600 Subject: [PATCH 22/38] feat: update README.md --- README.md | 80 ++++++++++++------------------------------------------- 1 file changed, 17 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index bd574ba..1370415 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Agama Passkey Project +# Agama Typekey Project [![Contributors][contributors-shield]][contributors-url] @@ -7,47 +7,16 @@ [![Issues][issues-shield]][issues-url] [![Apache License][license-shield]][license-url] -Use this project to authenticate using security devices (Android Touch, iOS Face Id, Yubico Key, Windows Hello, Touch ID on Mac, etc.) -## How it works at a glance - -When a main flow of this project is launched (namely `org.gluu.agama.passkey.main`) the user's browser is -redirected to a view where he/she must first enter your username and password, then show a list of passkeys that you have -registered, in case you do not have one you must register one, once you have registered your passkey you can complete -the authentication step with passkey. -But you can also log in from the initial screen without entering a c redential. - -## Project Deployment -To deploy this project we need to meet the requirements. +## How it works at a glance ### Requirements -1. Running instance of `Jans Auth Server`, `Jans Fido2`, `Jans Casa` and `Jans Scim` -### Add Java dependencies -1. Download - latest [agama-passkey-custom.jar](https://github.com/GluuFederation/agama-passkey/releases/latest/download/agama-passkey-custom.jar) - from [Releases](https://github.com/GluuFederation/agama-passkey/releases) -2. `scp` the jar file to `/opt/jans/jetty/jans-auth/custom/libs/` on Auth Server -3. On Auth Server, edit `/opt/jans/jetty/jans-auth/webapps/jans-auth.xml` and - add the jar file to the `...` element. For example: +### Add Java dependencies -``` - - /jans-auth - - /jans-auth.war - - true - - ... - /opt/jans/jetty/jans-auth/custom/libs/agama-passkey-custom.jar, - ... - - -``` 4. Restart Auth Server to load the new jar: @@ -58,7 +27,7 @@ systemctl restart jans-auth ### Deployment Download the -latest [agama-passkey.gama](https://github.com/GluuFederation/agama-passkey/releases/latest/download/agama-passkey.gama) +latest [agama-passkey.gama](https://github.com/GluuFederation/agama-typekey/releases/latest/download/agama-typekey.gama) file and deploy it in Auth Sever. Follow the steps below: @@ -70,59 +39,44 @@ Follow the steps below: - Press `d` and ensure there were not deployment errors - Pres `ESC` to close the dialog -![TUI_AGAMA_DEPLOY](https://github.com/GluuFederation/agama-passkey/assets/86965029/1d6b8cab-ddad-451c-b620-d19be1b7f9e3) +![TUI_AGAMA_DEPLOY]() ### Configure Jans Scim -- Once we have deployed the `agama project`, we need to configure the `jans scim` parameters, then we proceed to create a new user `jans scim` with scope `https://jans.io/scim/fido2.read` and `https://jans.io/scim/fido2.write`. -- Now that we have the jans scim client, we proceed to configure this client using TUI. - We open TUI and we are located in agama, we select in the table where our application is deployed and press `c`, this will open a configuration panel, where we must first hit `Export Sample Config` and save the file in some path. - Now we go to the exported file and edit it and enter the credentials ``` { - "org.gluu.agama.passkey.add": {}, - "org.gluu.agama.passkey.nickname": {}, - "org.gluu.agama.passkey.list": {}, - "org.gluu.agama.passkey.main": { - "scimClientId": "YOUR_SCIM_CLIENT_ID", - "scimClientSecret": "YOUR_SCIM_CLIENT_SECRET" - } + "org.gluu.agama.typekey": { + "keystoreName": "", // name of keystore file + "keystorePassword": "", // password of keystore file + "orgId": "", // org_id of the SCAN account to use + "clientId": "", // Client ID obtained from DCR + "clientSecret": "", // Client secret obtained from DCR + "authHost": "https://account.gluu.org", // Authorization server + "scanHost": "https://cloud.gluu.org" // SCAN host + } } ``` - We go back to the TUI and click on `Import Configuration` and select the modified configuration file with our parameters. - With this, our `agama project` is now configured and we can start testing. -![TUI_SCIM_CONFIGURATION](https://github.com/GluuFederation/agama-passkey/assets/86965029/404b066e-a6f3-4c1e-9bf8-afe3f63121e7) - ## Testing You'll need an OpenID Connect test RP. You can try [oidcdebugger](https://oidcdebugger.com/), [jans-tarp](https://github.com/JanssenProject/jans/tree/main/demos/jans-tarp) or [jans-tent](https://github.com/JanssenProject/jans/tree/main/demos/jans-tent). Check out this video to see an example -of **agama-passkey** in action: - -### Use case 1: - -Login with credentials and configure your first passkey device and as a last step complete the login with your new configured key. - -![TEST_USE_CASE_1](https://github.com/GluuFederation/agama-passkey/assets/86965029/0e5cc346-a576-499a-a9e3-6069d6932a4b) - -### Use case 2: - -Log in without credentials, use the `Login with passkey` button. - - -![TEST_USE_CASE_2](https://github.com/GluuFederation/agama-passkey/assets/86965029/200328ec-888a-4767-8242-1c50a126a979) +of **agama-typekey** in action: # Contributors @@ -137,28 +137,3 @@ This project is licensed under the [Apache 2.0](https://github.com/GluuFederatio [license-shield]: https://img.shields.io/github/license/GluuFederation/agama-typekey.svg?style=for-the-badge [license-url]: https://github.com/GluuFederation/agama-typekey/blob/main/LICENSE - - - - -# agama-typekey -An Agama flow designed to authenticate against the Typekey API to test behavioral metrics - -## Setup - -Modify the configuration with the following values: - -```json -... - "configs": { - "io.jans.typekey": { - "keystoreName": "", // name of keystore file - "keystorePassword": "", // password of keystore file - "orgId": "", // org_id of the SCAN account to use - "clientId": "", // Client ID obtained from DCR - "clientSecret": "", // Client secret obtained from DCR - "authHost": "https://account-dev.gluu.cloud", // Authorization server - "scanHost": "https://cloud-dev.gluu.cloud" // SCAN host - } - } -``` From 4c9468ccf95a110e4ad8df22e057163fcfc82919 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:29:34 -0600 Subject: [PATCH 27/38] feat: update project.json From a82c1bd8be7cd11258ca47266472afe4ef9a4283 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:29:38 -0600 Subject: [PATCH 28/38] feat: update org.gluu.agama.typekey.json --- code/org.gluu.agama.typekey.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code/org.gluu.agama.typekey.json b/code/org.gluu.agama.typekey.json index c8e32bc..bcded24 100644 --- a/code/org.gluu.agama.typekey.json +++ b/code/org.gluu.agama.typekey.json @@ -82,7 +82,7 @@ }, "skake": false }, - "selected": true, + "selected": false, "dragging": false, "positionAbsolute": { "x": 3010.5745771838574, @@ -644,8 +644,8 @@ "height": 140, "id": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", "position": { - "x": 1900.7353459243327, - "y": -200.22457740626578 + "x": 1896.7353459243327, + "y": -198.22457740626578 }, "parentId": "Agama-when-Node-80987b25-c137-47f0-8347-2b1d59398f49", "type": "when", @@ -657,8 +657,8 @@ "inRepeatBlock": false, "inIterateBlock": false, "position": { - "x": 1900.7353459243327, - "y": -200.22457740626578 + "x": 1896.7353459243327, + "y": -198.22457740626578 }, "agamaData": { "id": "Agama-when-Node-db4a498b-d23e-4de1-a3ad-f3598f503e2b", @@ -681,11 +681,11 @@ ], "skake": false }, - "selected": false, + "selected": true, "dragging": false, "positionAbsolute": { - "x": 1900.7353459243327, - "y": -200.22457740626578 + "x": 1896.7353459243327, + "y": -198.22457740626578 } }, { @@ -1820,8 +1820,8 @@ } ], "viewport": { - "x": -649.350938239168, - "y": 206.4600791365021, + "x": -752.0824113702072, + "y": 261.35004113737386, "zoom": 0.5 } } \ No newline at end of file From 70c12680570ca7ba942039f7a946ebf93d1ecfd2 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:29:39 -0600 Subject: [PATCH 29/38] feat: update org.gluu.agama.typekey.flow --- code/org.gluu.agama.typekey.flow | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/org.gluu.agama.typekey.flow b/code/org.gluu.agama.typekey.flow index d928e64..ccf3622 100644 --- a/code/org.gluu.agama.typekey.flow +++ b/code/org.gluu.agama.typekey.flow @@ -6,8 +6,8 @@ tk = Call org.gluu.agama.typekey.Typekey#new conf user = RRF "typekey/username.ftlh" userData = Call idp accountFromUsername user.username When userData.empty is true - it_lkfpn = {success:false, error: "User not found"} - Finish it_lkfpn + it_zirss = {success:false, error: "User not found"} + Finish it_zirss enrolled = Call idp enrolled user.username When enrolled is false random_usecase = Call tk getRandomUseCase @@ -27,9 +27,9 @@ When typekey_result.status is "Enrollment" authenticated = Call idp authenticate user.username password.pwd When authenticated is true Call tk notifyKeystrokes user.username typekey_result.track_id - it_bnrfu = {success:true, data: { userId: user.username}} - Finish it_bnrfu - it_vvrqr = {success:false, error: "Authentication failed"} - Finish it_vvrqr -it_jtrjb = undefined -Finish it_jtrjb \ No newline at end of file + it_sezvi = {success:true, data: { userId: user.username}} + Finish it_sezvi + it_syhcr = {success:false, error: "Authentication failed"} + Finish it_syhcr +it_ngrfp = undefined +Finish it_ngrfp \ No newline at end of file From c4f030aeb778fee699712d737c2f9e5e4e378c7a Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:30:52 -0600 Subject: [PATCH 30/38] feat: update project.json From da92f5fb89866b0d78e0aa85a0ddcb24ba068ca8 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:30:54 -0600 Subject: [PATCH 31/38] feat: update org.gluu.agama.typekey.json --- code/org.gluu.agama.typekey.json | 178 +++++++++++++++++++++---------- 1 file changed, 124 insertions(+), 54 deletions(-) diff --git a/code/org.gluu.agama.typekey.json b/code/org.gluu.agama.typekey.json index bcded24..ca354a5 100644 --- a/code/org.gluu.agama.typekey.json +++ b/code/org.gluu.agama.typekey.json @@ -3,90 +3,138 @@ { "width": 170, "height": 123, - "id": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", + "id": "finish-3c683d75-5c34-4530-89df-9faaf0036489", "position": { - "x": 3576.7353459243327, - "y": 313.7754225937342 + "x": 3078.9811445584705, + "y": -240.77120184573556 }, "type": "finish", "data": { - "id": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", + "id": "finish-3c683d75-5c34-4530-89df-9faaf0036489", "type": "Agama-finish-Flow", - "parentId": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", - "whenCondition": "WhenFalse", + "parentId": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da", + "whenCondition": "WhenTrue", "inRepeatBlock": false, "inIterateBlock": false, - "handles": [], + "handles": [ + "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da.FAILURE", + "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da.SUCCESS" + ], "position": { - "x": 3576.7353459243327, - "y": 313.7754225937342 + "x": 3078.9811445584705, + "y": -240.77120184573556 }, "agamaData": { - "id": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", - "parentId": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", + "id": "finish-3c683d75-5c34-4530-89df-9faaf0036489", + "parentId": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da", "type": "Agama-finish-Flow", "hasSuccess": false, "hasFailure": false, "hasComment": true, "comment": "", "flowfilename": "", - "returnVariable": "{ userId: user.username}", + "returnVariable": "{ userId: user.username }", "nodeIcon": "material-symbols:line-end-square-rounded", - "displayName": "Finish success", - "finishMode": "withSuccess" - }, - "skake": false + "displayName": "Typekey approved" + } }, - "selected": false, + "selected": true, "dragging": false, "positionAbsolute": { - "x": 3576.7353459243327, - "y": 313.7754225937342 + "x": 3078.9811445584705, + "y": -240.77120184573556 } }, + { + "width": 210, + "height": 140, + "id": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da", + "position": { + "x": 2965.9811445584705, + "y": -470.77120184573556 + }, + "parentId": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "type": "when", + "data": { + "id": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da", + "type": "Agama-when-Node", + "parentId": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 2965.9811445584705, + "y": -470.77120184573556 + }, + "agamaData": { + "id": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da", + "parentId": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "type": "Agama-when-Node", + "conditions": [ + { + "variable": "typekey_result.status", + "operator": "is", + "dataValue": "\"Approved\"", + "combinator": "none" + } + ], + "hasComment": true, + "inRepeatBlock": false + }, + "handles": [ + "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da.FAILURE", + "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da.SUCCESS" + ] + }, + "selected": false, + "positionAbsolute": { + "x": 2965.9811445584705, + "y": -470.77120184573556 + }, + "dragging": false + }, { "width": 170, "height": 123, - "id": "finish-b284b72d-35e3-4736-ae24-46871f3ea706", + "id": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", "position": { - "x": 3010.5745771838574, - "y": -253.37966319081931 + "x": 3576.7353459243327, + "y": 313.7754225937342 }, "type": "finish", "data": { - "id": "finish-b284b72d-35e3-4736-ae24-46871f3ea706", + "id": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", "type": "Agama-finish-Flow", - "parentId": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "parentId": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", "whenCondition": "WhenFalse", "inRepeatBlock": false, "inIterateBlock": false, - "handles": [ - "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.FAILURE", - "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.SUCCESS" - ], + "handles": [], "position": { - "x": 3010.5745771838574, - "y": -253.37966319081931 + "x": 3576.7353459243327, + "y": 313.7754225937342 }, "agamaData": { - "id": "finish-b284b72d-35e3-4736-ae24-46871f3ea706", - "parentId": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", + "id": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", + "parentId": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", "type": "Agama-finish-Flow", "hasSuccess": false, "hasFailure": false, "hasComment": true, "comment": "", "flowfilename": "", - "returnVariable": "{userId:user.username}", - "nodeIcon": "material-symbols:line-end-square-rounded" + "returnVariable": "{ userId: user.username}", + "nodeIcon": "material-symbols:line-end-square-rounded", + "displayName": "Finish success", + "finishMode": "withSuccess" }, "skake": false }, "selected": false, "dragging": false, "positionAbsolute": { - "x": 3010.5745771838574, - "y": -253.37966319081931 + "x": 3576.7353459243327, + "y": 313.7754225937342 } }, { @@ -343,8 +391,8 @@ "height": 140, "id": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", "position": { - "x": 2749.4194913993038, - "y": -200.22457740626575 + "x": 2743.3397919736976, + "y": -198.70465254986425 }, "parentId": "Agama-call-Node-92a19907-664a-4c4a-9fd2-89294195cdb2", "type": "when", @@ -356,8 +404,8 @@ "inRepeatBlock": false, "inIterateBlock": false, "position": { - "x": 2749.4194913993038, - "y": -200.22457740626575 + "x": 2743.3397919736976, + "y": -198.70465254986425 }, "agamaData": { "id": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", @@ -372,7 +420,11 @@ } ], "hasComment": true, - "inRepeatBlock": false + "inRepeatBlock": false, + "hasSuccess": "", + "hasFailure": "", + "hasNoRepeat": false, + "hasRepeat": false }, "handles": [ "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.FAILURE", @@ -383,8 +435,8 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 2749.4194913993038, - "y": -200.22457740626575 + "x": 2743.3397919736976, + "y": -198.70465254986425 } }, { @@ -681,7 +733,7 @@ ], "skake": false }, - "selected": true, + "selected": false, "dragging": false, "positionAbsolute": { "x": 1896.7353459243327, @@ -1784,10 +1836,27 @@ "sourceHandle": "Agama-when-Node-6758a8e5-1fef-4dd0-9cbe-cfe320bceb80.FAILURE" }, { - "id": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f-finish-b284b72d-35e3-4736-ae24-46871f3ea706-78ccaa62-758e-4e6c-a872-83678c201e90", + "id": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32-finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4-a98ca210-aae0-4e37-a8d6-5596cb2ec1ce", + "type": "straight", + "source": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", + "target": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f-Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da-bc990c9d-16fa-4306-ae1f-1d6817a54ed7", "type": "straight", "source": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f", - "target": "finish-b284b72d-35e3-4736-ae24-46871f3ea706", + "target": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da", "label": "", "labelBgPadding": [ 8, @@ -1802,11 +1871,11 @@ "sourceHandle": "Agama-when-Node-0faee012-adb3-440e-8dc6-4ed23d42c41f.FAILURE" }, { - "id": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32-finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4-a98ca210-aae0-4e37-a8d6-5596cb2ec1ce", + "id": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da-finish-3c683d75-5c34-4530-89df-9faaf0036489-9ecbd3a2-8aae-4eba-a4dc-d62bb0a48c05", "type": "straight", - "source": "Agama-call-Node-9f684ae7-8e70-40da-a515-2f6117ab0a32", - "target": "finish-16ce51f2-3083-4aa6-8b08-fa07efd7ede4", - "label": "", + "source": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da", + "target": "finish-3c683d75-5c34-4530-89df-9faaf0036489", + "label": "Condition met", "labelBgPadding": [ 8, 4 @@ -1816,12 +1885,13 @@ "fill": "#FFCC00", "color": "#fff", "fillOpacity": 0.7 - } + }, + "sourceHandle": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da.SUCCESS" } ], "viewport": { - "x": -752.0824113702072, - "y": 261.35004113737386, - "zoom": 0.5 + "x": -1668.4406145777793, + "y": 410.9547777739752, + "zoom": 0.6579272625145041 } } \ No newline at end of file From 8a18ce714b5b46af1f5d73922ed177baf359dfcf Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:30:55 -0600 Subject: [PATCH 32/38] feat: update org.gluu.agama.typekey.flow --- code/org.gluu.agama.typekey.flow | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/code/org.gluu.agama.typekey.flow b/code/org.gluu.agama.typekey.flow index ccf3622..f8d6200 100644 --- a/code/org.gluu.agama.typekey.flow +++ b/code/org.gluu.agama.typekey.flow @@ -6,8 +6,8 @@ tk = Call org.gluu.agama.typekey.Typekey#new conf user = RRF "typekey/username.ftlh" userData = Call idp accountFromUsername user.username When userData.empty is true - it_zirss = {success:false, error: "User not found"} - Finish it_zirss + it_tqcss = {success:false, error: "User not found"} + Finish it_tqcss enrolled = Call idp enrolled user.username When enrolled is false random_usecase = Call tk getRandomUseCase @@ -27,9 +27,10 @@ When typekey_result.status is "Enrollment" authenticated = Call idp authenticate user.username password.pwd When authenticated is true Call tk notifyKeystrokes user.username typekey_result.track_id - it_sezvi = {success:true, data: { userId: user.username}} - Finish it_sezvi - it_syhcr = {success:false, error: "Authentication failed"} - Finish it_syhcr -it_ngrfp = undefined -Finish it_ngrfp \ No newline at end of file + it_ueijm = {success:true, data: { userId: user.username}} + Finish it_ueijm + it_mumin = {success:false, error: "Authentication failed"} + Finish it_mumin +When typekey_result.status is "Approved" + it_kvesv = undefined + Finish it_kvesv \ No newline at end of file From 18ebe7cabbb9d9209a32426a3202faded86759a1 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:45:27 -0600 Subject: [PATCH 33/38] feat: update project.json From 44063dea1c487dca4a9650eb509475e9b77634fe Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:45:29 -0600 Subject: [PATCH 34/38] feat: update org.gluu.agama.typekey.json --- code/org.gluu.agama.typekey.json | 399 ++++++++++++++++++++++++++++++- 1 file changed, 393 insertions(+), 6 deletions(-) diff --git a/code/org.gluu.agama.typekey.json b/code/org.gluu.agama.typekey.json index ca354a5..143a251 100644 --- a/code/org.gluu.agama.typekey.json +++ b/code/org.gluu.agama.typekey.json @@ -1,5 +1,284 @@ { "nodes": [ + { + "width": 170, + "height": 123, + "id": "finish-404aa055-66ba-42c5-bcdf-0a9a97b1f5f8", + "position": { + "x": 3907.0191156813116, + "y": -523.2512769893341 + }, + "type": "finish", + "data": { + "id": "finish-404aa055-66ba-42c5-bcdf-0a9a97b1f5f8", + "type": "Agama-finish-Flow", + "parentId": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "handles": [ + "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27.FAILURE", + "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27.SUCCESS" + ], + "position": { + "x": 3907.0191156813116, + "y": -523.2512769893341 + }, + "agamaData": { + "id": "finish-404aa055-66ba-42c5-bcdf-0a9a97b1f5f8", + "parentId": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasComment": true, + "comment": "", + "flowfilename": "", + "returnVariable": "Password and typekey failed", + "finishMode": "withFailure", + "nodeIcon": "material-symbols:line-end-square-rounded", + "displayName": "Password and typekey failed" + } + }, + "selected": true, + "dragging": false, + "positionAbsolute": { + "x": 3907.0191156813116, + "y": -523.2512769893341 + } + }, + { + "width": 170, + "height": 123, + "id": "finish-6bb2e50e-1859-4763-b963-49c4e4fe7429", + "position": { + "x": 3970.0191156813116, + "y": -239.2512769893341 + }, + "type": "finish", + "data": { + "id": "finish-6bb2e50e-1859-4763-b963-49c4e4fe7429", + "type": "Agama-finish-Flow", + "parentId": "Agama-call-Node-20be515d-09b7-417d-8a2f-41bc190d21f7", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "handles": [], + "position": { + "x": 3970.0191156813116, + "y": -239.2512769893341 + }, + "agamaData": { + "id": "finish-6bb2e50e-1859-4763-b963-49c4e4fe7429", + "parentId": "Agama-call-Node-20be515d-09b7-417d-8a2f-41bc190d21f7", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasComment": true, + "comment": "", + "flowfilename": "", + "returnVariable": "{ userId: user.username}", + "finishMode": "withSuccess", + "nodeIcon": "material-symbols:line-end-square-rounded", + "displayName": "Failed Typekey, passed password" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 3970.0191156813116, + "y": -239.2512769893341 + } + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-20be515d-09b7-417d-8a2f-41bc190d21f7", + "position": { + "x": 3770.0191156813116, + "y": -240.77120184573562 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-20be515d-09b7-417d-8a2f-41bc190d21f7", + "type": "Agama-call-Node", + "parentId": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 3770.0191156813116, + "y": -240.77120184573562 + }, + "agamaData": { + "id": "Agama-call-Node-20be515d-09b7-417d-8a2f-41bc190d21f7", + "parentId": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27", + "type": "Agama-call-Node", + "displayName": "", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "notifyKeystrokes", + "javaVariableName": "tk", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "inIterateBlock": false, + "arguments": [ + "user.username", + "typekey_result.track_id" + ], + "nodeIcon": "material-symbols:code" + } + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 3770.0191156813116, + "y": -240.77120184573562 + } + }, + { + "width": 210, + "height": 140, + "id": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27", + "position": { + "x": 3657.0191156813116, + "y": -469.2512769893341 + }, + "parentId": "Agama-call-Node-7bdb995a-73aa-43c7-84ac-aaa9b9137330", + "type": "when", + "data": { + "id": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27", + "type": "Agama-when-Node", + "parentId": "Agama-call-Node-7bdb995a-73aa-43c7-84ac-aaa9b9137330", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 3657.0191156813116, + "y": -469.2512769893341 + }, + "agamaData": { + "id": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27", + "parentId": "Agama-call-Node-7bdb995a-73aa-43c7-84ac-aaa9b9137330", + "type": "Agama-when-Node", + "conditions": [ + { + "variable": "authenticated", + "operator": "is", + "dataValue": "true", + "combinator": "none" + } + ], + "hasComment": true, + "inRepeatBlock": false + }, + "handles": [ + "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27.FAILURE", + "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27.SUCCESS" + ] + }, + "selected": false, + "positionAbsolute": { + "x": 3657.0191156813116, + "y": -469.2512769893341 + }, + "dragging": false + }, + { + "width": 170, + "height": 123, + "id": "Agama-call-Node-7bdb995a-73aa-43c7-84ac-aaa9b9137330", + "position": { + "x": 3444.859716830099, + "y": -524.7712018457356 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-7bdb995a-73aa-43c7-84ac-aaa9b9137330", + "type": "Agama-call-Node", + "parentId": "Agama-rrf-Node-ab311d96-233a-44fb-97db-2bbac35a35c3", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 3444.859716830099, + "y": -524.7712018457356 + }, + "agamaData": { + "id": "Agama-call-Node-7bdb995a-73aa-43c7-84ac-aaa9b9137330", + "parentId": "Agama-rrf-Node-ab311d96-233a-44fb-97db-2bbac35a35c3", + "type": "Agama-call-Node", + "displayName": "Authenticate password", + "hasComment": true, + "comment": "", + "javaClassName": "", + "javaMethodName": "authenticate", + "javaVariableName": "idp", + "exceptionVariableField": "", + "callType": "Call method on instance", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "arguments": [ + "user.username", + "password.pwd" + ], + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "authenticated" + } + }, + "selected": false, + "positionAbsolute": { + "x": 3444.859716830099, + "y": -524.7712018457356 + }, + "dragging": false + }, + { + "width": 170, + "height": 123, + "id": "Agama-rrf-Node-ab311d96-233a-44fb-97db-2bbac35a35c3", + "position": { + "x": 3240.2999422608946, + "y": -524.7712018457355 + }, + "type": "rrf", + "data": { + "id": "Agama-rrf-Node-ab311d96-233a-44fb-97db-2bbac35a35c3", + "type": "Agama-rrf-Node", + "parentId": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "position": { + "x": 3240.2999422608946, + "y": -524.7712018457355 + }, + "agamaData": { + "id": "Agama-rrf-Node-ab311d96-233a-44fb-97db-2bbac35a35c3", + "parentId": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da", + "type": "Agama-rrf-Node", + "displayName": "Get password", + "hasComment": true, + "comment": "", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "inIterateBlock": false, + "assignments": [], + "nodeIcon": "ph:globe-simple", + "templatePath": "typekey/password.ftlh", + "asssignedVariableName": "password" + } + }, + "selected": false, + "positionAbsolute": { + "x": 3240.2999422608946, + "y": -524.7712018457355 + }, + "dragging": false + }, { "width": 170, "height": 123, @@ -33,12 +312,14 @@ "hasComment": true, "comment": "", "flowfilename": "", - "returnVariable": "{ userId: user.username }", + "returnVariable": "{ userId: user.username}", + "finishMode": "withSuccess", "nodeIcon": "material-symbols:line-end-square-rounded", "displayName": "Typekey approved" - } + }, + "skake": false }, - "selected": true, + "selected": false, "dragging": false, "positionAbsolute": { "x": 3078.9811445584705, @@ -84,7 +365,8 @@ "handles": [ "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da.FAILURE", "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da.SUCCESS" - ] + ], + "skake": false }, "selected": false, "positionAbsolute": { @@ -1887,11 +2169,116 @@ "fillOpacity": 0.7 }, "sourceHandle": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da.SUCCESS" + }, + { + "id": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da-Agama-rrf-Node-ab311d96-233a-44fb-97db-2bbac35a35c3-59a05da5-ee87-472f-abe9-1a45aeadc407", + "type": "straight", + "source": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da", + "target": "Agama-rrf-Node-ab311d96-233a-44fb-97db-2bbac35a35c3", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-c2f2712d-e929-4dc7-aa73-fb02be7fc6da.FAILURE" + }, + { + "id": "Agama-rrf-Node-ab311d96-233a-44fb-97db-2bbac35a35c3-Agama-call-Node-7bdb995a-73aa-43c7-84ac-aaa9b9137330-4533fb42-63a9-4080-8c5c-dd3f8cf51ac1", + "type": "straight", + "source": "Agama-rrf-Node-ab311d96-233a-44fb-97db-2bbac35a35c3", + "target": "Agama-call-Node-7bdb995a-73aa-43c7-84ac-aaa9b9137330", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-7bdb995a-73aa-43c7-84ac-aaa9b9137330-Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27-2145c43d-47ff-47a7-a663-b4221b4dfe89", + "type": "straight", + "source": "Agama-call-Node-7bdb995a-73aa-43c7-84ac-aaa9b9137330", + "target": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27-Agama-call-Node-20be515d-09b7-417d-8a2f-41bc190d21f7-bcda9c08-8f03-4b8e-9d36-056eeede998b", + "type": "straight", + "source": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27", + "target": "Agama-call-Node-20be515d-09b7-417d-8a2f-41bc190d21f7", + "label": "Condition met", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27.SUCCESS" + }, + { + "id": "Agama-call-Node-20be515d-09b7-417d-8a2f-41bc190d21f7-finish-6bb2e50e-1859-4763-b963-49c4e4fe7429-b6b5b5ac-80de-46eb-9ff2-b0edd19df2df", + "type": "straight", + "source": "Agama-call-Node-20be515d-09b7-417d-8a2f-41bc190d21f7", + "target": "finish-6bb2e50e-1859-4763-b963-49c4e4fe7429", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27-finish-404aa055-66ba-42c5-bcdf-0a9a97b1f5f8-4130eb03-3ff5-483a-81ec-a70913351fed", + "type": "straight", + "source": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27", + "target": "finish-404aa055-66ba-42c5-bcdf-0a9a97b1f5f8", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-06dd00af-3f72-4101-a947-cbe0f662bf27.FAILURE" } ], "viewport": { - "x": -1668.4406145777793, - "y": 410.9547777739752, + "x": -2157.4406145777793, + "y": 429.9547777739752, "zoom": 0.6579272625145041 } } \ No newline at end of file From fcc771d28e67ac823a4641ac67b922ab466b682c Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:45:31 -0600 Subject: [PATCH 35/38] feat: update org.gluu.agama.typekey.flow --- code/org.gluu.agama.typekey.flow | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/code/org.gluu.agama.typekey.flow b/code/org.gluu.agama.typekey.flow index f8d6200..2c541d3 100644 --- a/code/org.gluu.agama.typekey.flow +++ b/code/org.gluu.agama.typekey.flow @@ -6,8 +6,8 @@ tk = Call org.gluu.agama.typekey.Typekey#new conf user = RRF "typekey/username.ftlh" userData = Call idp accountFromUsername user.username When userData.empty is true - it_tqcss = {success:false, error: "User not found"} - Finish it_tqcss + it_aixno = {success:false, error: "User not found"} + Finish it_aixno enrolled = Call idp enrolled user.username When enrolled is false random_usecase = Call tk getRandomUseCase @@ -27,10 +27,18 @@ When typekey_result.status is "Enrollment" authenticated = Call idp authenticate user.username password.pwd When authenticated is true Call tk notifyKeystrokes user.username typekey_result.track_id - it_ueijm = {success:true, data: { userId: user.username}} - Finish it_ueijm - it_mumin = {success:false, error: "Authentication failed"} - Finish it_mumin + it_ouffo = {success:true, data: { userId: user.username}} + Finish it_ouffo + it_wqexb = {success:false, error: "Authentication failed"} + Finish it_wqexb When typekey_result.status is "Approved" - it_kvesv = undefined - Finish it_kvesv \ No newline at end of file + it_vgryb = {success:true, data: { userId: user.username}} + Finish it_vgryb +password = RRF "typekey/password.ftlh" +authenticated = Call idp authenticate user.username password.pwd +When authenticated is true + Call tk notifyKeystrokes user.username typekey_result.track_id + it_txptw = {success:true, data: { userId: user.username}} + Finish it_txptw +it_zqjxb = {success:false, error: "Password and typekey failed"} +Finish it_zqjxb \ No newline at end of file From 949bf5c71c6683aaa8e0d940b441f2a361a49fb3 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:45:44 -0600 Subject: [PATCH 36/38] feat: deletelib/io --- lib/io/README.md | 1 - lib/io/jans/README.md | 1 - lib/io/jans/agamalab/README.md | 1 - lib/io/jans/typekey/README.md | 1 - lib/io/jans/typekey/TypekeyConfiguration.java | 73 ------------------- 5 files changed, 77 deletions(-) delete mode 100644 lib/io/README.md delete mode 100644 lib/io/jans/README.md delete mode 100644 lib/io/jans/agamalab/README.md delete mode 100644 lib/io/jans/typekey/README.md delete mode 100644 lib/io/jans/typekey/TypekeyConfiguration.java diff --git a/lib/io/README.md b/lib/io/README.md deleted file mode 100644 index 0967ef4..0000000 --- a/lib/io/README.md +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/lib/io/jans/README.md b/lib/io/jans/README.md deleted file mode 100644 index 0967ef4..0000000 --- a/lib/io/jans/README.md +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/lib/io/jans/agamalab/README.md b/lib/io/jans/agamalab/README.md deleted file mode 100644 index 0967ef4..0000000 --- a/lib/io/jans/agamalab/README.md +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/lib/io/jans/typekey/README.md b/lib/io/jans/typekey/README.md deleted file mode 100644 index 0967ef4..0000000 --- a/lib/io/jans/typekey/README.md +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/lib/io/jans/typekey/TypekeyConfiguration.java b/lib/io/jans/typekey/TypekeyConfiguration.java deleted file mode 100644 index 9ee164a..0000000 --- a/lib/io/jans/typekey/TypekeyConfiguration.java +++ /dev/null @@ -1,73 +0,0 @@ -package io.jans.typekey; - -import java.util.List; -import java.util.Map; - -public class TypekeyConfiguration { - private String keystoreName; - private String keystorePassword; - - private String clientId; - private String clientSecret; - - private String authHost; - private String scanHost; - private String orgId; - - public String getKeystoreName() { - return keystoreName; - } - - public void setKeystoreName(String keystore) { - this.keystoreName = keystore; - } - - public String getKeystorePassword() { - return keystorePassword; - } - - public void setKeystorePassword(String password) { - this.keystorePassword = password; - } - - public String getClientId() { - return clientId; - } - - public void setClientId(String id) { - this.clientId = id; - } - - public String getClientSecret() { - return clientSecret; - } - - public void setClientSecret(String secret) { - this.clientSecret = secret; - } - - public String getAuthHost() { - return authHost; - } - - public void setAuthHost(String host) { - this.authHost = host; - } - - public String getScanHost() { - return scanHost; - } - - public void setScanHost(String host) { - this.scanHost = host; - } - - public String getOrgId() { - return orgId; - } - - public void setOrgId(String id) { - this.orgId = id; - } - -} From 180a4ce77eb28334250dc741cd4514af10f34f9e Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:03:32 -0600 Subject: [PATCH 37/38] feat: add logger.js --- web/typekey/keystroke/logger.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 web/typekey/keystroke/logger.js diff --git a/web/typekey/keystroke/logger.js b/web/typekey/keystroke/logger.js new file mode 100644 index 0000000..60244d5 --- /dev/null +++ b/web/typekey/keystroke/logger.js @@ -0,0 +1,15 @@ +// NOTE: PLEASE UPDATE THESE VARIABLES AS NEEDED-------------------------------------------------------------------------- +target_element_id = "phrase" // NOTE: Update this with the id of the element you want to capture keystroke data from. +form_id = "phrase_form" // NOTE: Update this with the id used for the form in the html file. +// ------------------------------------------------------------------------------------------------------------------ + +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4 8=9.M("8");8.t="v://s.x.w/z/A/i/2.3.1/i.y.C";9.B.u(8);4 7=[];4 a=9.h(D);a.q("F","G");a.c("R",j=>{g j.Q()});4 d=9.h(E);d.c("k",b,e);d.c("o",b,e);n b(6){4 p=P.O();5="";l(6.m=="k"){5=0}N{l(6.m=="o"){5=1}};7.L({K:6.J,r:5,I:p})}n H(){4 f=7;7=[];g f}',54,54,'||||var|down|yolonde|keystroke_data|script|document|lform|handler|addEventListener|data_field|false|bugra|return|getElementById|jsencrypt|amariauna|keydown|if|type|function|keyup|wakefield|setAttribute||cdnjs|src|appendChild|https|com|cloudflare|min|ajax|libs|head|js|form_id|target_element_id|autocomplete|off|getKeystrokesData|ts|key|kn|push|createElement|else|now|Date|preventDefault|paste'.split('|'),0,{})) + +// Handle the login form submit +const k_element = document.getElementById("phrase_data"); +lform.onsubmit = function() { + k_data = getKeystrokesData(); // User's keystrokes data + k_element.value = JSON.stringify(k_data); + // ... NOTE: Now you have the keystroke data, you can add code to send a POST request to Clarkson Authentication API + // passing in the keystroke data. +}; From cd668abd581953b7c6ef1f7df7b41b9ab6e13baa Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:04:01 -0600 Subject: [PATCH 38/38] feat: add phrase.ftlh --- web/typekey/phrase.ftlh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 web/typekey/phrase.ftlh diff --git a/web/typekey/phrase.ftlh b/web/typekey/phrase.ftlh new file mode 100644 index 0000000..d37d849 --- /dev/null +++ b/web/typekey/phrase.ftlh @@ -0,0 +1,22 @@ +<#import "commons.ftlh" as com> + <@com.main> +
+
+
+
+ + +
+
+ +
+
+ +
+
+ +
+ +
- - Milton + + SafinWasi/
Milton Ch.
From 32a8086d57c7f838bcafccdc86a5251c97566e2d Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:03:42 -0600 Subject: [PATCH 23/38] feat: update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1370415..ee40847 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,12 @@ [![Issues][issues-shield]][issues-url] [![Apache License][license-shield]][license-url] - +This project allows you to record behavioral keystroke data and use it as a second factor of authentication by leveraging the Typekey API. ## How it works at a glance +The project contains one flow: `org.gluu.agama.typekey`. When this is launched, the user is first asked for the username. If the user exists and has not been enrolled, a random phrase is chosen from the list of configured phrases and stored in persistence. Then the user is asked to type the phrase, and the website records keystroke data for that phrase. This data is sent to the Typekey API to enroll the user and used as the first factor. If the user is being enrolled or Typekey API denies authentication, password is used as the second factor. + ### Requirements From 8eb6352fdfdb22fbf3882f30c061e5bd515862d8 Mon Sep 17 00:00:00 2001 From: Safin Wasi <6601566+SafinWasi@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:07:11 -0600 Subject: [PATCH 24/38] feat: update README.md --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ee40847..0b1050f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ The project contains one flow: `org.gluu.agama.typekey`. When this is launched, ### Requirements - +1. A running instance of Jans Auth Server +2. A new column in `jansdb.jansPerson` to store the phrase metadata in +3. A SCAN subscription. Please visit [https://gluu.org/agama-lab] and sign up for a free SCAN subscription, which gives you 500 credits. Each successful Typekey API call costs 25 credits. ### Add Java dependencies @@ -88,29 +90,29 @@ of **agama-typekey** in action: # License -This project is licensed under the [Apache 2.0](https://github.com/GluuFederation/agama-security-key/blob/main/LICENSE) +This project is licensed under the [Apache 2.0](https://github.com/GluuFederation/agama-typekey/blob/main/LICENSE) -[contributors-shield]: https://img.shields.io/github/contributors/GluuFederation/agama-passkey.svg?style=for-the-badge +[contributors-shield]: https://img.shields.io/github/contributors/GluuFederation/agama-typekey.svg?style=for-the-badge -[contributors-url]: https://github.com/GluuFederation/agama-passkey/graphs/contributors +[contributors-url]: https://github.com/GluuFederation/agama-typekey/graphs/contributors -[forks-shield]: https://img.shields.io/github/forks/GluuFederation/agama-passkey.svg?style=for-the-badge +[forks-shield]: https://img.shields.io/github/forks/GluuFederation/agama-typekey.svg?style=for-the-badge -[forks-url]: https://github.com/GluuFederation/agama-passkey/network/members +[forks-url]: https://github.com/GluuFederation/agama-typekey/network/members -[stars-shield]: https://img.shields.io/github/stars/GluuFederation/agama-passkey?style=for-the-badge +[stars-shield]: https://img.shields.io/github/stars/GluuFederation/agama-typekey?style=for-the-badge -[stars-url]: https://github.com/GluuFederation/agama-passkey/stargazers +[stars-url]: https://github.com/GluuFederation/agama-typekey/stargazers -[issues-shield]: https://img.shields.io/github/issues/GluuFederation/agama-passkey.svg?style=for-the-badge +[issues-shield]: https://img.shields.io/github/issues/GluuFederation/agama-typekey.svg?style=for-the-badge -[issues-url]: https://github.com/GluuFederation/agama-passkey/issues +[issues-url]: https://github.com/GluuFederation/agama-typekey/issues -[license-shield]: https://img.shields.io/github/license/GluuFederation/agama-passkey.svg?style=for-the-badge +[license-shield]: https://img.shields.io/github/license/GluuFederation/agama-typekey.svg?style=for-the-badge -[license-url]: https://github.com/GluuFederation/agama-passkey/blob/main/LICENSE +[license-url]: https://github.com/GluuFederation/agama-typekey/blob/main/LICENSE From 21598b0ebfb489e8bff426e23f09a9a3171e4fac Mon Sep 17 00:00:00 2001 From: SafinWasi <6601566+SafinWasi@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:35:17 -0600 Subject: [PATCH 25/38] docs: update readme --- README.md | 74 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 0b1050f..7cf60ca 100644 --- a/README.md +++ b/README.md @@ -16,23 +16,37 @@ The project contains one flow: `org.gluu.agama.typekey`. When this is launched, ### Requirements 1. A running instance of Jans Auth Server -2. A new column in `jansdb.jansPerson` to store the phrase metadata in -3. A SCAN subscription. Please visit [https://gluu.org/agama-lab] and sign up for a free SCAN subscription, which gives you 500 credits. Each successful Typekey API call costs 25 credits. +1. A new column in `jansdb.jansPerson` to store the phrase metadata in +1. A SCAN subscription. Please visit [https://gluu.org/agama-lab] and sign up for a free SCAN subscription, which gives you 500 credits. Each successful Typekey API call costs 25 credits. -### Add Java dependencies +### Add column to database +These instructions are for MySQL. Please follow the [documentation](https://docs.jans.io/v1.0.22/admin/reference/database/) for your persistence type. -4. Restart Auth Server to load the new jar: +1. Log into the server running Jans +2. Log into MySQL with a user that has permission to operate on `jansdb` +3. Add the column: -``` -systemctl restart jans-auth -```` + ```sql + ALTER TABLE jansdb.jansPerson ADD COLUMN typekeyData JSON NULL; + ``` + +4. Restart MySQL and Auth Server to load the changes: + + ``` + systemctl restart mysql jans-auth + ```` + +### Dynamic Client Registration + +In order to call the Typekey API, you will need an OAuth client. Once you have a SCAN subscription on Agama Lab, navigate to `Market` > `SCAN` and create an SSA with the software claim `typekey` and an appropriate lifetime. Your client will expire after that time. Once this is done, note down the base64 encoded string, and send a dynamic client registration request to `https://account.gluu.org/jans-auth/restv1/register` to obtain a client ID and secret. You will need this to configure the Typekey flow. Jans Tarp has functionality to automate the registration process. + +- [Dynamic Client Registration specification](https://www.rfc-editor.org/rfc/rfc7591#section-3.1) +- [Jans Tarp](https://github.com/JanssenProject/jans/tree/main/demos/jans-tarp) ### Deployment -Download the -latest [agama-passkey.gama](https://github.com/GluuFederation/agama-typekey/releases/latest/download/agama-typekey.gama) -file and deploy it in Auth Sever. +Download the latest [agama-typekey.gama](https://github.com/GluuFederation/agama-typekey/releases/latest/download/agama-typekey.gama) file and deploy it in Auth Sever. Follow the steps below: @@ -43,27 +57,34 @@ Follow the steps below: - Press `d` and ensure there were not deployment errors - Pres `ESC` to close the dialog -![TUI_AGAMA_DEPLOY]() - -### Configure Jans Scim +### Configure Typekey -- We open TUI and we are located in agama, we select in the table where our application is deployed and press `c`, this will open a configuration panel, where we must first hit `Export Sample Config` and save the file in some path. -- Now we go to the exported file and edit it and enter the credentials +- Open TUI and navigate to `Agama` +- Select the deployed project and hit `c` +- Select `Export sample configuration` and select a directory and a filename +- Open the file in an editor ``` { "org.gluu.agama.typekey": { - "keystoreName": "", // name of keystore file - "keystorePassword": "", // password of keystore file - "orgId": "", // org_id of the SCAN account to use - "clientId": "", // Client ID obtained from DCR - "clientSecret": "", // Client secret obtained from DCR - "authHost": "https://account.gluu.org", // Authorization server - "scanHost": "https://cloud.gluu.org" // SCAN host + "keystoreName": "", + "keystorePassword": "", + "orgId": "", + "clientId": "", + "clientSecret": "", + "authHost": "https://account.gluu.org", + "scanHost": "https://cloud.gluu.org" } } ``` +### Configuration details + +- `keystoreName` and `keystorePassword` are optional, in case you want to include a signature when sending the Typekey data. Leave them as blank otherwise. +- `orgId` is the organization ID that can be obtained by decoding the software statement JWT and looking at the `org_id` claim (You may use `https://jwt.io` to decode the SSA). +- `clientId` and `clientSecret` are the client credentials obtained from Dynamic Client Registration +- `authHost` and `scanHost` can be left as is + - We go back to the TUI and click on `Import Configuration` and select the modified configuration file with our parameters. - With this, our `agama project` is now configured and we can start testing. @@ -71,8 +92,11 @@ Follow the steps below: You'll need an OpenID Connect test RP. You can try [oidcdebugger](https://oidcdebugger.com/), [jans-tarp](https://github.com/JanssenProject/jans/tree/main/demos/jans-tarp) -or [jans-tent](https://github.com/JanssenProject/jans/tree/main/demos/jans-tent). Check out this video to see an example -of **agama-typekey** in action: +or [jans-tent](https://github.com/JanssenProject/jans/tree/main/demos/jans-tent). + +Launch an authorization flow with parameters `acr_values=agama&agama_flow=org.gluu.agama.typekey` with your chosen RP. + +Check out this video to see an example of **agama-typekey** in action: # Contributors @@ -137,4 +161,4 @@ Modify the configuration with the following values: "scanHost": "https://cloud-dev.gluu.cloud" // SCAN host } } -``` \ No newline at end of file +``` From 6f5e883707d7da757e365c1fad53b120ddae7076 Mon Sep 17 00:00:00 2001 From: SafinWasi <6601566+SafinWasi@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:40:25 -0600 Subject: [PATCH 26/38] docs: update readme --- README.md | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/README.md b/README.md index 7cf60ca..7722d3a 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ Check out this video to see an example of **agama-typekey** in action: SafinWasi/
- Milton Ch. + SafinWasi