From ee2070ef44b081cb1fbda67cdc5b09966cfb3b8e Mon Sep 17 00:00:00 2001 From: Milton Ch Date: Wed, 3 Apr 2024 21:56:14 -0400 Subject: [PATCH 01/90] feat: removed agama-inbound dependency Signed-off-by: Milton Ch --- lib/org/gluu/agama/securitykey/CasaWSBase.java | 1 - .../gluu/agama/securitykey/IdentityProcessor.java | 6 ++++-- lib/org/gluu/agama/securitykey/NetworkUtils.java | 12 ++++++++++++ .../gluu/agama/securitykey/authn/FidoValidator.java | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 lib/org/gluu/agama/securitykey/NetworkUtils.java diff --git a/lib/org/gluu/agama/securitykey/CasaWSBase.java b/lib/org/gluu/agama/securitykey/CasaWSBase.java index b2f564a..28b03aa 100644 --- a/lib/org/gluu/agama/securitykey/CasaWSBase.java +++ b/lib/org/gluu/agama/securitykey/CasaWSBase.java @@ -7,7 +7,6 @@ import io.jans.casa.model.ApplicationConfiguration; import io.jans.orm.PersistenceEntryManager; import io.jans.service.cdi.util.CdiUtil; -import io.jans.util.NetworkUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/lib/org/gluu/agama/securitykey/IdentityProcessor.java b/lib/org/gluu/agama/securitykey/IdentityProcessor.java index 1215145..f332769 100644 --- a/lib/org/gluu/agama/securitykey/IdentityProcessor.java +++ b/lib/org/gluu/agama/securitykey/IdentityProcessor.java @@ -12,13 +12,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static io.jans.inbound.Attrs.*; - public class IdentityProcessor { private static final Logger logger = LoggerFactory.getLogger(IdentityProcessor.class); private static final String INUM_ATTR = "inum"; + private static final String UID = "uid"; + private static final String GIVEN_NAME = "givenName"; + private static final String DISPLAY_NAME = "displayName"; + private static final String MAIL = "mail"; public static Map accountFromUid(String uid) { User user = getUser(UID, uid); diff --git a/lib/org/gluu/agama/securitykey/NetworkUtils.java b/lib/org/gluu/agama/securitykey/NetworkUtils.java new file mode 100644 index 0000000..a439450 --- /dev/null +++ b/lib/org/gluu/agama/securitykey/NetworkUtils.java @@ -0,0 +1,12 @@ +package org.gluu.agama.securitykey; + +import io.jans.service.cdi.util.CdiUtil; +import jakarta.servlet.http.HttpServletRequest; + +public class NetworkUtils { + + public static String urlBeforeContextPath() { + HttpServletRequest req = CdiUtil.bean(HttpServletRequest.class); + return req.getScheme() + "://" + req.getServerName(); + } +} diff --git a/lib/org/gluu/agama/securitykey/authn/FidoValidator.java b/lib/org/gluu/agama/securitykey/authn/FidoValidator.java index ff7e374..46d2a8f 100644 --- a/lib/org/gluu/agama/securitykey/authn/FidoValidator.java +++ b/lib/org/gluu/agama/securitykey/authn/FidoValidator.java @@ -2,7 +2,6 @@ import io.jans.fido2.client.AssertionService; import io.jans.fido2.client.Fido2ClientFactory; -import io.jans.util.NetworkUtils; import jakarta.ws.rs.core.Response; @@ -11,6 +10,7 @@ import net.minidev.json.JSONObject; +import org.gluu.agama.securitykey.NetworkUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; From 879ecd6002077a0c1a46beada46d1bbe55dda047 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 22:20:40 -0400 Subject: [PATCH 02/90] feat: update project.json From 06029bf9f2e3bf1a0c7d2dad14b8ad6bfc18a3a7 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 22:20:42 -0400 Subject: [PATCH 03/90] feat: update org.gluu.agama.securitykey.main.json --- code/org.gluu.agama.securitykey.main.json | 159 +++++++++++++--------- 1 file changed, 95 insertions(+), 64 deletions(-) diff --git a/code/org.gluu.agama.securitykey.main.json b/code/org.gluu.agama.securitykey.main.json index 998dfbf..5ac72c3 100644 --- a/code/org.gluu.agama.securitykey.main.json +++ b/code/org.gluu.agama.securitykey.main.json @@ -2,7 +2,7 @@ "nodes": [ { "width": 170, - "height": 122, + "height": 124, "id": "Agama-assignment-Node-6bff7f73-09f5-47db-855c-dd07c9e35d66", "position": { "x": 1983, @@ -77,11 +77,11 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "finish-50e8d4d6-ffbe-4f51-a172-73bf524e08fc", "position": { "x": 1117, - "y": 31 + "y": 30.19053674373663 }, "type": "finish", "data": { @@ -96,7 +96,7 @@ ], "position": { "x": 1117, - "y": 31 + "y": 30.19053674373663 }, "agamaData": { "id": "finish-50e8d4d6-ffbe-4f51-a172-73bf524e08fc", @@ -112,7 +112,7 @@ "parentId": "Agama-repeat-Node-a94063b4-1329-4cc0-a1e5-2da976165946", "name": "", "basepath": "", - "comment": "", + "comment": "When the maximum number of attempts has been made, the flow will end.", "notes": "", "flowfilename": "", "assignments": [ @@ -139,7 +139,7 @@ "logLevel": "", "assignCallbackResult": "", "displayName": "Finish with limited exceeded", - "nodeColor": "", + "nodeColor": "#eb999a", "exceptionVariableField": "", "finishMode": "withFailure", "hasExtraData": false, @@ -148,16 +148,16 @@ }, "skake": false }, - "selected": true, + "selected": false, "dragging": false, "positionAbsolute": { "x": 1117, - "y": 31 + "y": 30.19053674373663 } }, { "width": 170, - "height": 122, + "height": 124, "id": "finish-35163906-b1cf-4a51-aad2-e091c4a86a25", "position": { "x": 4080, @@ -236,8 +236,8 @@ } }, { - "width": 210, - "height": 140, + "width": 110, + "height": 60, "id": "Agama-when-Node-d871f2c0-b007-42bf-8859-d8cd34bc5018", "position": { "x": 3888, @@ -271,7 +271,15 @@ "conditionInputField": "is", "valueField": "true", "hasComment": true, - "hasSuccess": true + "hasSuccess": true, + "conditions": [ + { + "variable": "fidoAuthn.success", + "operator": "is", + "dataValue": "true", + "combinator": "none" + } + ] }, "handles": [ "Agama-when-Node-d871f2c0-b007-42bf-8859-d8cd34bc5018.FAILURE", @@ -288,7 +296,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-log-Node-6c7bf514-0783-4793-997e-4fe611846373", "position": { "x": 3673, @@ -363,7 +371,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "finish-b0730d9c-be75-4311-a96d-e7f8f401e4ff", "position": { "x": 3171, @@ -442,8 +450,8 @@ } }, { - "width": 210, - "height": 140, + "width": 110, + "height": 60, "id": "Agama-when-Node-f506e361-5ab3-499c-bb6b-e0ccc49e5ad1", "position": { "x": 3016, @@ -478,7 +486,15 @@ "valueField": "0", "hasComment": true, "hasSuccess": true, - "hasFailure": true + "hasFailure": true, + "conditions": [ + { + "variable": "count", + "operator": "is", + "dataValue": "0", + "combinator": "none" + } + ] }, "handles": [ "Agama-when-Node-f506e361-5ab3-499c-bb6b-e0ccc49e5ad1.FAILURE", @@ -495,7 +511,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-log-Node-59c922ed-bca1-43ac-b92d-5961edac11f0", "position": { "x": 2806, @@ -570,7 +586,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-call-Node-ce503f35-ef74-42d5-bdaa-d0de9618ffc4", "position": { "x": 2219, @@ -648,7 +664,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-assignment-Node-453d3af0-06ba-496a-9265-bdd2a96cc511", "position": { "x": 2027, @@ -723,7 +739,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-assignment-Node-c418619f-b914-4b42-b214-d681fae5a48a", "position": { "x": 1836, @@ -797,8 +813,8 @@ "dragging": false }, { - "width": 210, - "height": 140, + "width": 110, + "height": 60, "id": "Agama-when-Node-ebb3dc63-b8f3-4405-b1cc-4c3c541feadc", "position": { "x": 1718, @@ -835,7 +851,15 @@ "hasSuccess": "", "hasFailure": true, "hasNoRepeat": false, - "hasRepeat": false + "hasRepeat": false, + "conditions": [ + { + "variable": "userData", + "operator": "is not", + "dataValue": "null", + "combinator": "none" + } + ] }, "handles": [ "Agama-when-Node-ebb3dc63-b8f3-4405-b1cc-4c3c541feadc.FAILURE", @@ -852,7 +876,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-call-Node-fb1ad7aa-2953-4c81-8231-e6cb5636a7e0", "position": { "x": 1124, @@ -930,7 +954,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-rrf-Node-9f6ee7dc-524c-4515-a90c-d7185f48f855", "position": { "x": 925, @@ -972,7 +996,9 @@ } ], "callType": "Call static method", - "arguments": "loginForm", + "arguments": [ + "loginForm" + ], "logMessage": "", "templatePath": "main.ftlh", "maxIteration": "", @@ -987,7 +1013,7 @@ "maxIterationVariableName": "", "logLevel": "", "assignCallbackResult": "", - "displayName": "Main view", + "displayName": "Render main view", "nodeColor": "", "exceptionVariableField": "", "hasExtraData": false, @@ -1006,7 +1032,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-repeat-Node-a94063b4-1329-4cc0-a1e5-2da976165946", "position": { "x": 830, @@ -1019,7 +1045,10 @@ "parentId": "Agama-call-Node-5a5db4fa-51fe-4f63-aca2-987a05a4e33c", "whenCondition": "", "inRepeatBlock": false, - "handles": [], + "handles": [ + "Agama-repeat-Node-a94063b4-1329-4cc0-a1e5-2da976165946.InFlow", + "Agama-repeat-Node-a94063b4-1329-4cc0-a1e5-2da976165946.InRepeatBlock" + ], "position": { "x": 830, "y": 28 @@ -1038,7 +1067,7 @@ "parentId": "Agama-call-Node-5a5db4fa-51fe-4f63-aca2-987a05a4e33c", "name": "", "basepath": "", - "comment": "", + "comment": "Repeat a maximum of 3 times", "notes": "", "flowfilename": "", "assignments": [ @@ -1082,11 +1111,11 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-call-Node-5a5db4fa-51fe-4f63-aca2-987a05a4e33c", "position": { "x": 630, - "y": 29 + "y": 28.19053674373663 }, "type": "call", "data": { @@ -1097,7 +1126,7 @@ "inRepeatBlock": false, "position": { "x": 630, - "y": 29 + "y": 28.19053674373663 }, "agamaData": { "id": "Agama-call-Node-5a5db4fa-51fe-4f63-aca2-987a05a4e33c", @@ -1113,7 +1142,7 @@ "parentId": "Agama-assignment-Node-dde74028-8751-449f-a64a-33158ec89db2", "name": "", "basepath": "", - "comment": "", + "comment": "Get instance CasaApi", "notes": "", "flowfilename": "", "assignments": [ @@ -1153,16 +1182,16 @@ "dragging": false, "positionAbsolute": { "x": 630, - "y": 29 + "y": 28.19053674373663 } }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-assignment-Node-dde74028-8751-449f-a64a-33158ec89db2", "position": { "x": 430, - "y": 29 + "y": 28.19053674373663 }, "type": "assignment", "data": { @@ -1173,7 +1202,7 @@ "inRepeatBlock": false, "position": { "x": 430, - "y": 29 + "y": 28.19053674373663 }, "agamaData": { "id": "Agama-assignment-Node-dde74028-8751-449f-a64a-33158ec89db2", @@ -1189,7 +1218,7 @@ "parentId": "Agama-log-Node-39599a98-0915-479f-94b4-ca00fa143214", "name": "", "basepath": "", - "comment": "", + "comment": "loginForm variable declaration, which is sent to the main form", "notes": "", "flowfilename": "", "assignments": [ @@ -1228,12 +1257,12 @@ "dragging": false, "positionAbsolute": { "x": 430, - "y": 29 + "y": 28.19053674373663 } }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-log-Node-39599a98-0915-479f-94b4-ca00fa143214", "position": { "x": 230, @@ -1264,7 +1293,7 @@ "parentId": "Agama-start-Flow-b152daa8-8e5d-4204-9518-3c11143edcfc", "name": "", "basepath": "", - "comment": "", + "comment": "Mark startup logs", "notes": "", "flowfilename": "", "assignments": [ @@ -1308,7 +1337,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-start-Flow-b152daa8-8e5d-4204-9518-3c11143edcfc", "type": "start", "sourcePosition": "right", @@ -1316,8 +1345,8 @@ "id": "Agama-start-Flow-b152daa8-8e5d-4204-9518-3c11143edcfc", "type": "Agama-start-Flow", "position": { - "x": 30, - "y": 29 + "x": 29.190536743736686, + "y": 28.19053674373663 }, "inRepeatBlock": false, "agamaData": { @@ -1332,7 +1361,7 @@ "inRepeatBlock": false, "name": "", "basepath": "", - "comment": "", + "comment": "Main flow that handles all other flows", "notes": "", "flowfilename": "", "assignments": [], @@ -1352,29 +1381,31 @@ "maxIterationVariableName": "", "logLevel": "", "assignCallbackResult": "", - "displayName": "Main", + "displayName": "SecurityKey Main", "nodeColor": "", "exceptionVariableField": "", "hasExtraData": false, "configParams": "{}", - "flowname": "org.gluu.agama.securitykey.main" + "flowname": "org.gluu.agama.securitykey.main", + "timeout": "", + "inputs": "" }, "skake": false }, "position": { - "x": 30, - "y": 29 + "x": 29.190536743736686, + "y": 28.19053674373663 }, "selected": false, "positionAbsolute": { - "x": 30, - "y": 29 + "x": 29.190536743736686, + "y": 28.19053674373663 }, "dragging": false }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-assignment-Node-4ce21e85-93a1-4c4b-9d46-1487f7b20cc4", "position": { "x": 3268, @@ -1449,7 +1480,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-trigger-Node-118e8cc7-12f5-4c84-88cb-27340124f1c4", "position": { "x": 3475, @@ -1510,7 +1541,7 @@ "logLevel": "", "assignCallbackResult": "", "displayName": "FidoAuthn trigger", - "nodeColor": "", + "nodeColor": "#80deea", "exceptionVariableField": "", "hasExtraData": false, "configParams": "{}", @@ -1520,7 +1551,7 @@ }, "skake": false }, - "selected": false, + "selected": true, "dragging": false, "positionAbsolute": { "x": 3475, @@ -1532,7 +1563,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-log-Node-ced6f3aa-230e-4cb3-a223-457dd23de03c", "position": { "x": 2414, @@ -1607,7 +1638,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-assignment-Node-f9572780-7965-4ed6-b345-8a835fdafddb", "position": { "x": 2606, @@ -1688,7 +1719,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-log-Node-b731280f-7322-49ff-b8ea-052cc933a0ba", "position": { "x": 1324, @@ -1763,7 +1794,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-assignment-Node-5f55bd0a-21ad-4368-8d20-d3073122fa3c", "position": { "x": 1517, @@ -2261,8 +2292,8 @@ } ], "viewport": { - "x": 10, - "y": 15, - "zoom": 1 + "x": 228.32541990727577, + "y": 45.12573158637372, + "zoom": 1.0460577497628043 } } \ No newline at end of file From e55c10d305d1bb7976cd6b91d9a200710adc7e06 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 22:20:43 -0400 Subject: [PATCH 04/90] feat: update org.gluu.agama.securitykey.main.flow --- code/org.gluu.agama.securitykey.main.flow | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/code/org.gluu.agama.securitykey.main.flow b/code/org.gluu.agama.securitykey.main.flow index f63c1d9..ade1f98 100644 --- a/code/org.gluu.agama.securitykey.main.flow +++ b/code/org.gluu.agama.securitykey.main.flow @@ -1,8 +1,13 @@ +// Main flow that handles all other flows Flow org.gluu.agama.securitykey.main Basepath "" +// Mark startup logs Log "@debug Main flow started!" +// loginForm variable declaration, which is sent to the main form loginForm = { success: true } -casaApi = Call org.gluu.agama.securitykey.CasaApi#new +// Get instance CasaApi +casaApi = Call org.gluu.agama.securitykey.CasaApi#new +// Repeat a maximum of 3 times Repeat 3 times max creds = RRF "main.ftlh" loginForm userData = Call org.gluu.agama.securitykey.IdentityProcessor#accountFromUid creds.username @@ -16,13 +21,10 @@ Repeat 3 times max count = mfaInfo.count Log "@debug User % has % credentials enrolled" inum count When count is 0 - it_aagka = { success: false, error: "Your account has no security key configured." } - Finish it_aagka + it_qtack = {success:false, error: "Your account has no security key configured."} + Finish it_qtack withEscape = true - fidoAuthn = Trigger org.gluu.agama.securitykey.fidoAuthn userData withEscape - Log "@debug Response FidoAuthn %" fidoAuthn - When fidoAuthn.success is true - Finish uid loginForm.success = false -it_sxdfm = { success: false, error: "Login attempt exceeded." } -Finish it_sxdfm \ No newline at end of file +// When the maximum number of attempts has been made, the flow will end. +it_bapfq = {success:false, error: "Login attempt exceeded."} +Finish it_bapfq \ No newline at end of file From 8936be269c0654139ffd97ab3f3afa9f25934b8d Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:15:22 -0400 Subject: [PATCH 05/90] feat: update project.json From f2b8eba823ba8f4d3fb4067d570796c1b089b4b4 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:15:24 -0400 Subject: [PATCH 06/90] feat: update org.gluu.agama.securitykey.main.json --- code/org.gluu.agama.securitykey.main.json | 250 ++++++++-------------- 1 file changed, 93 insertions(+), 157 deletions(-) diff --git a/code/org.gluu.agama.securitykey.main.json b/code/org.gluu.agama.securitykey.main.json index 5ac72c3..46bde98 100644 --- a/code/org.gluu.agama.securitykey.main.json +++ b/code/org.gluu.agama.securitykey.main.json @@ -33,7 +33,7 @@ "parentId": "Agama-when-Node-ebb3dc63-b8f3-4405-b1cc-4c3c541feadc", "name": "", "basepath": "", - "comment": "", + "comment": "Set the loginForm success field to false", "notes": "", "flowfilename": "", "assignments": [ @@ -160,8 +160,8 @@ "height": 124, "id": "finish-35163906-b1cf-4a51-aad2-e091c4a86a25", "position": { - "x": 4080, - "y": 663 + "x": 4016.3047734707898, + "y": 673.6992044215352 }, "type": "finish", "data": { @@ -175,8 +175,8 @@ "Agama-when-Node-d871f2c0-b007-42bf-8859-d8cd34bc5018.SUCCESS" ], "position": { - "x": 4080, - "y": 663 + "x": 4016.3047734707898, + "y": 673.6992044215352 }, "agamaData": { "id": "finish-35163906-b1cf-4a51-aad2-e091c4a86a25", @@ -192,7 +192,7 @@ "parentId": "Agama-when-Node-d871f2c0-b007-42bf-8859-d8cd34bc5018", "name": "", "basepath": "", - "comment": "", + "comment": "Finish flow with return uid", "notes": "", "flowfilename": "", "assignments": [ @@ -231,8 +231,8 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 4080, - "y": 663 + "x": 4016.3047734707898, + "y": 673.6992044215352 } }, { @@ -240,8 +240,8 @@ "height": 60, "id": "Agama-when-Node-d871f2c0-b007-42bf-8859-d8cd34bc5018", "position": { - "x": 3888, - "y": 525 + "x": 3896.7538945267106, + "y": 530.8359296844737 }, "parentId": "Agama-log-Node-6c7bf514-0783-4793-997e-4fe611846373", "type": "when", @@ -252,8 +252,8 @@ "whenCondition": "", "inRepeatBlock": true, "position": { - "x": 3888, - "y": 525 + "x": 3896.7538945267106, + "y": 530.8359296844737 }, "agamaData": { "id": "Agama-when-Node-d871f2c0-b007-42bf-8859-d8cd34bc5018", @@ -290,8 +290,8 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 3888, - "y": 525 + "x": 3896.7538945267106, + "y": 530.8359296844737 } }, { @@ -299,8 +299,8 @@ "height": 124, "id": "Agama-log-Node-6c7bf514-0783-4793-997e-4fe611846373", "position": { - "x": 3673, - "y": 475 + "x": 3701, + "y": 474 }, "type": "log", "data": { @@ -310,8 +310,8 @@ "whenCondition": "", "inRepeatBlock": true, "position": { - "x": 3673, - "y": 475 + "x": 3701, + "y": 474 }, "agamaData": { "id": "Agama-log-Node-6c7bf514-0783-4793-997e-4fe611846373", @@ -327,7 +327,7 @@ "parentId": "Agama-trigger-Node-118e8cc7-12f5-4c84-88cb-27340124f1c4", "name": "", "basepath": "", - "comment": "", + "comment": "Mark logs Authentication flow response executed", "notes": "", "flowfilename": "", "assignments": [ @@ -362,11 +362,11 @@ }, "skake": false }, - "selected": false, + "selected": true, "dragging": false, "positionAbsolute": { - "x": 3673, - "y": 475 + "x": 3701, + "y": 474 } }, { @@ -375,7 +375,7 @@ "id": "finish-b0730d9c-be75-4311-a96d-e7f8f401e4ff", "position": { "x": 3171, - "y": 732 + "y": 731.5 }, "type": "finish", "data": { @@ -390,7 +390,7 @@ ], "position": { "x": 3171, - "y": 732 + "y": 731.5 }, "agamaData": { "id": "finish-b0730d9c-be75-4311-a96d-e7f8f401e4ff", @@ -406,7 +406,7 @@ "parentId": "Agama-when-Node-f506e361-5ab3-499c-bb6b-e0ccc49e5ad1", "name": "", "basepath": "", - "comment": "", + "comment": "Ended the flow if you have no registered positives.", "notes": "", "flowfilename": "", "assignments": [ @@ -446,7 +446,7 @@ "dragging": false, "positionAbsolute": { "x": 3171, - "y": 732 + "y": 731.5 } }, { @@ -454,7 +454,7 @@ "height": 60, "id": "Agama-when-Node-f506e361-5ab3-499c-bb6b-e0ccc49e5ad1", "position": { - "x": 3016, + "x": 2866, "y": 532 }, "parentId": "Agama-log-Node-59c922ed-bca1-43ac-b92d-5961edac11f0", @@ -466,7 +466,7 @@ "whenCondition": "", "inRepeatBlock": true, "position": { - "x": 3016, + "x": 2866, "y": 532 }, "agamaData": { @@ -505,7 +505,7 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 3016, + "x": 2866, "y": 532 } }, @@ -514,8 +514,8 @@ "height": 124, "id": "Agama-log-Node-59c922ed-bca1-43ac-b92d-5961edac11f0", "position": { - "x": 2806, - "y": 483 + "x": 2656, + "y": 482 }, "type": "log", "data": { @@ -525,8 +525,8 @@ "whenCondition": "", "inRepeatBlock": true, "position": { - "x": 2806, - "y": 483 + "x": 2656, + "y": 482 }, "agamaData": { "id": "Agama-log-Node-59c922ed-bca1-43ac-b92d-5961edac11f0", @@ -542,7 +542,7 @@ "parentId": "Agama-assignment-Node-f9572780-7965-4ed6-b345-8a835fdafddb", "name": "", "basepath": "", - "comment": "", + "comment": "Mark the user's logs and the number of devices he/she has registered.", "notes": "", "flowfilename": "", "assignments": [ @@ -580,8 +580,8 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 2806, - "y": 483 + "x": 2656, + "y": 482 } }, { @@ -589,19 +589,19 @@ "height": 124, "id": "Agama-call-Node-ce503f35-ef74-42d5-bdaa-d0de9618ffc4", "position": { - "x": 2219, - "y": 477 + "x": 2069, + "y": 477.97265494741237 }, "type": "call", "data": { "id": "Agama-call-Node-ce503f35-ef74-42d5-bdaa-d0de9618ffc4", "type": "Agama-call-Node", - "parentId": "Agama-assignment-Node-453d3af0-06ba-496a-9265-bdd2a96cc511", + "parentId": "Agama-assignment-Node-c418619f-b914-4b42-b214-d681fae5a48a", "whenCondition": "", "inRepeatBlock": true, "position": { - "x": 2219, - "y": 477 + "x": 2069, + "y": 477.97265494741237 }, "agamaData": { "id": "Agama-call-Node-ce503f35-ef74-42d5-bdaa-d0de9618ffc4", @@ -617,7 +617,7 @@ "parentId": "Agama-assignment-Node-453d3af0-06ba-496a-9265-bdd2a96cc511", "name": "", "basepath": "", - "comment": "", + "comment": "Gets the number of security key devices registered by the user.", "notes": "", "flowfilename": "", "assignments": [ @@ -658,83 +658,8 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 2219, - "y": 477 - } - }, - { - "width": 170, - "height": 124, - "id": "Agama-assignment-Node-453d3af0-06ba-496a-9265-bdd2a96cc511", - "position": { - "x": 2027, - "y": 480 - }, - "type": "assignment", - "data": { - "id": "Agama-assignment-Node-453d3af0-06ba-496a-9265-bdd2a96cc511", - "type": "Agama-assignment-Node", - "parentId": "Agama-assignment-Node-c418619f-b914-4b42-b214-d681fae5a48a", - "whenCondition": "", - "inRepeatBlock": true, - "position": { - "x": 2027, - "y": 480 - }, - "agamaData": { - "id": "Agama-assignment-Node-453d3af0-06ba-496a-9265-bdd2a96cc511", - "type": "Agama-assignment-Node", - "hasSuccess": false, - "hasFailure": false, - "hasRepeat": false, - "hasComment": true, - "hasNoRepeat": false, - "isTopLevelFlow": true, - "whenCondition": "", - "inRepeatBlock": true, - "parentId": "Agama-assignment-Node-c418619f-b914-4b42-b214-d681fae5a48a", - "name": "", - "basepath": "", - "comment": "", - "notes": "", - "flowfilename": "", - "assignments": [ - { - "variableTypeCheck": false, - "assignmentExpression": "userData.uid", - "assignedVariableName": "uid" - } - ], - "callType": "Call static method", - "arguments": [], - "logMessage": "", - "templatePath": "", - "maxIteration": "", - "idpAuthEndpoint": "", - "variableField": "", - "conditionInputField": "", - "valueField": "", - "returnVariable": "", - "javaClassName": "", - "javaMethodName": "", - "javaVariableName": "", - "maxIterationVariableName": "", - "logLevel": "", - "assignCallbackResult": "", - "displayName": "Uid initialize", - "nodeColor": "", - "exceptionVariableField": "", - "hasExtraData": false, - "configParams": "{}", - "nodeIcon": "material-symbols:equal" - }, - "skake": false - }, - "selected": false, - "dragging": false, - "positionAbsolute": { - "x": 2027, - "y": 480 + "x": 2069, + "y": 477.97265494741237 } }, { @@ -743,7 +668,7 @@ "id": "Agama-assignment-Node-c418619f-b914-4b42-b214-d681fae5a48a", "position": { "x": 1836, - "y": 478 + "y": 477.3026281668249 }, "type": "assignment", "data": { @@ -754,7 +679,7 @@ "inRepeatBlock": true, "position": { "x": 1836, - "y": 478 + "y": 477.3026281668249 }, "agamaData": { "id": "Agama-assignment-Node-c418619f-b914-4b42-b214-d681fae5a48a", @@ -770,7 +695,7 @@ "parentId": "Agama-when-Node-ebb3dc63-b8f3-4405-b1cc-4c3c541feadc", "name": "", "basepath": "", - "comment": "", + "comment": "Initialization of inum and uid", "notes": "", "flowfilename": "", "assignments": [ @@ -778,6 +703,11 @@ "variableTypeCheck": false, "assignmentExpression": "userData.inum", "assignedVariableName": "inum" + }, + { + "variableTypeCheck": false, + "assignmentExpression": "userData.uid", + "assignedVariableName": "uid" } ], "callType": "Call static method", @@ -796,7 +726,7 @@ "maxIterationVariableName": "", "logLevel": "", "assignCallbackResult": "", - "displayName": "Inum initialize", + "displayName": "Inum and uid initialize", "nodeColor": "", "exceptionVariableField": "", "hasExtraData": false, @@ -808,7 +738,7 @@ "selected": false, "positionAbsolute": { "x": 1836, - "y": 478 + "y": 477.3026281668249 }, "dragging": false }, @@ -907,7 +837,7 @@ "parentId": "Agama-rrf-Node-9f6ee7dc-524c-4515-a90c-d7185f48f855", "name": "", "basepath": "", - "comment": "", + "comment": "Retrieves the user's information by username", "notes": "", "flowfilename": "", "assignments": [ @@ -985,7 +915,7 @@ "parentId": "Agama-repeat-Node-a94063b4-1329-4cc0-a1e5-2da976165946", "name": "", "basepath": "", - "comment": "", + "comment": "Load main.ftlh page and pass loginForm", "notes": "", "flowfilename": "", "assignments": [ @@ -1408,8 +1338,8 @@ "height": 124, "id": "Agama-assignment-Node-4ce21e85-93a1-4c4b-9d46-1487f7b20cc4", "position": { - "x": 3268, - "y": 478 + "x": 3240, + "y": 474.5 }, "type": "assignment", "data": { @@ -1419,8 +1349,8 @@ "whenCondition": "WhenFalse", "inRepeatBlock": true, "position": { - "x": 3268, - "y": 478 + "x": 3240, + "y": 474.5 }, "agamaData": { "id": "Agama-assignment-Node-4ce21e85-93a1-4c4b-9d46-1487f7b20cc4", @@ -1436,7 +1366,7 @@ "parentId": "Agama-when-Node-f506e361-5ab3-499c-bb6b-e0ccc49e5ad1", "name": "", "basepath": "", - "comment": "", + "comment": "Assign withEscape = true", "notes": "", "flowfilename": "", "assignments": [ @@ -1474,8 +1404,8 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 3268, - "y": 478 + "x": 3240, + "y": 474.5 } }, { @@ -1484,7 +1414,7 @@ "id": "Agama-trigger-Node-118e8cc7-12f5-4c84-88cb-27340124f1c4", "position": { "x": 3475, - "y": 474 + "y": 473.5 }, "type": "trigger", "data": { @@ -1495,7 +1425,7 @@ "inRepeatBlock": "", "position": { "x": 3475, - "y": 474 + "y": 473.5 }, "agamaData": { "id": "Agama-trigger-Node-118e8cc7-12f5-4c84-88cb-27340124f1c4", @@ -1511,7 +1441,7 @@ "parentId": "Agama-when-Node-f506e361-5ab3-499c-bb6b-e0ccc49e5ad1", "name": "", "basepath": "", - "comment": "", + "comment": "FIDO authentication flow", "notes": "", "flowfilename": "", "assignments": [ @@ -1551,11 +1481,11 @@ }, "skake": false }, - "selected": true, + "selected": false, "dragging": false, "positionAbsolute": { "x": 3475, - "y": 474 + "y": 473.5 }, "parentId": "Agama-assignment-Node-4ce21e85-93a1-4c4b-9d46-1487f7b20cc4", "whenCondition": "", @@ -1566,7 +1496,7 @@ "height": 124, "id": "Agama-log-Node-ced6f3aa-230e-4cb3-a223-457dd23de03c", "position": { - "x": 2414, + "x": 2264, "y": 479 }, "type": "log", @@ -1577,7 +1507,7 @@ "whenCondition": "", "inRepeatBlock": true, "position": { - "x": 2414, + "x": 2264, "y": 479 }, "agamaData": { @@ -1594,7 +1524,7 @@ "parentId": "Agama-call-Node-ce503f35-ef74-42d5-bdaa-d0de9618ffc4", "name": "", "basepath": "", - "comment": "", + "comment": "Logs of the number of registered devices", "notes": "", "flowfilename": "", "assignments": [ @@ -1632,7 +1562,7 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 2414, + "x": 2264, "y": 479 } }, @@ -1641,8 +1571,8 @@ "height": 124, "id": "Agama-assignment-Node-f9572780-7965-4ed6-b345-8a835fdafddb", "position": { - "x": 2606, - "y": 480 + "x": 2456, + "y": 479.5 }, "type": "assignment", "data": { @@ -1652,8 +1582,8 @@ "whenCondition": "", "inRepeatBlock": "", "position": { - "x": 2606, - "y": 480 + "x": 2456, + "y": 479.5 }, "agamaData": { "id": "Agama-assignment-Node-f9572780-7965-4ed6-b345-8a835fdafddb", @@ -1669,7 +1599,7 @@ "parentId": "Agama-log-Node-ced6f3aa-230e-4cb3-a223-457dd23de03c", "name": "", "basepath": "", - "comment": "", + "comment": "Variable count declaration", "notes": "", "flowfilename": "", "assignments": [ @@ -1710,8 +1640,8 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 2606, - "y": 480 + "x": 2456, + "y": 479.5 }, "parentId": "Agama-log-Node-ced6f3aa-230e-4cb3-a223-457dd23de03c", "whenCondition": "", @@ -1723,7 +1653,7 @@ "id": "Agama-log-Node-b731280f-7322-49ff-b8ea-052cc933a0ba", "position": { "x": 1324, - "y": 258 + "y": 257.40950366928524 }, "type": "log", "data": { @@ -1734,7 +1664,7 @@ "inRepeatBlock": true, "position": { "x": 1324, - "y": 258 + "y": 257.40950366928524 }, "agamaData": { "id": "Agama-log-Node-b731280f-7322-49ff-b8ea-052cc933a0ba", @@ -1750,7 +1680,7 @@ "parentId": "Agama-call-Node-fb1ad7aa-2953-4c81-8231-e6cb5636a7e0", "name": "", "basepath": "", - "comment": "", + "comment": "Mark logs of collected user data", "notes": "", "flowfilename": "", "assignments": [ @@ -1789,7 +1719,7 @@ "dragging": false, "positionAbsolute": { "x": 1324, - "y": 258 + "y": 257.40950366928524 } }, { @@ -1825,7 +1755,7 @@ "parentId": "Agama-log-Node-b731280f-7322-49ff-b8ea-052cc933a0ba", "name": "", "basepath": "", - "comment": "", + "comment": "Assign loginForm.username = creds.username", "notes": "", "flowfilename": "", "assignments": [ @@ -2289,11 +2219,17 @@ "fillOpacity": 0.7 }, "sourceHandle": "Agama-when-Node-ebb3dc63-b8f3-4405-b1cc-4c3c541feadc.FAILURE" + }, + { + "id": "Agama-assignment-Node-c418619f-b914-4b42-b214-d681fae5a48a-Agama-call-Node-ce503f35-ef74-42d5-bdaa-d0de9618ffc4-d18633a7-6ce5-4f75-846f-e946a0294b71", + "type": "default", + "source": "Agama-assignment-Node-c418619f-b914-4b42-b214-d681fae5a48a", + "target": "Agama-call-Node-ce503f35-ef74-42d5-bdaa-d0de9618ffc4" } ], "viewport": { - "x": 228.32541990727577, - "y": 45.12573158637372, - "zoom": 1.0460577497628043 + "x": -7720.558026915904, + "y": -857.462372734504, + "zoom": 2 } } \ No newline at end of file From fbcd6206289d601bddd43c0878a40ee35102b3ad Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:15:25 -0400 Subject: [PATCH 07/90] feat: update org.gluu.agama.securitykey.main.flow --- code/org.gluu.agama.securitykey.main.flow | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/code/org.gluu.agama.securitykey.main.flow b/code/org.gluu.agama.securitykey.main.flow index ade1f98..e8e97f8 100644 --- a/code/org.gluu.agama.securitykey.main.flow +++ b/code/org.gluu.agama.securitykey.main.flow @@ -9,22 +9,20 @@ loginForm = { success: true } casaApi = Call org.gluu.agama.securitykey.CasaApi#new // Repeat a maximum of 3 times Repeat 3 times max + // Load main.ftlh page and pass loginForm creds = RRF "main.ftlh" loginForm + // Retrieves the user's information by username userData = Call org.gluu.agama.securitykey.IdentityProcessor#accountFromUid creds.username + // Mark logs of collected user data Log "@debug UserData %" userData + // Assign loginForm.username = creds.username loginForm.username = creds.username When userData is not null + // Initialization of inum and uid inum = userData.inum uid = userData.uid - mfaInfo = Call casaApi getMFAUserInfoByFido2 inum - Log "@debug MfaInfo response: %" mfaInfo - count = mfaInfo.count - Log "@debug User % has % credentials enrolled" inum count - When count is 0 - it_qtack = {success:false, error: "Your account has no security key configured."} - Finish it_qtack - withEscape = true + // Set the loginForm success field to false loginForm.success = false // When the maximum number of attempts has been made, the flow will end. -it_bapfq = {success:false, error: "Login attempt exceeded."} -Finish it_bapfq \ No newline at end of file +it_bmqcr = {success:false, error: "Login attempt exceeded."} +Finish it_bmqcr \ No newline at end of file From 1e71b7c18674c88bf77cc4b8d643c52a4852abcf Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:26:06 -0400 Subject: [PATCH 08/90] feat: update project.json From 1fe3a60b49ef97291d2930322a5d404edeb91d46 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:26:08 -0400 Subject: [PATCH 09/90] feat: update org.gluu.agama.securitykey.main.json --- code/org.gluu.agama.securitykey.main.json | 113 ++++++++++++++++++---- 1 file changed, 94 insertions(+), 19 deletions(-) diff --git a/code/org.gluu.agama.securitykey.main.json b/code/org.gluu.agama.securitykey.main.json index 46bde98..0fc85d8 100644 --- a/code/org.gluu.agama.securitykey.main.json +++ b/code/org.gluu.agama.securitykey.main.json @@ -1,5 +1,80 @@ { "nodes": [ + { + "width": 266, + "height": 30, + "id": "Agama-note-65eb07be-d51a-4e6a-a761-7a8d9ff3c46c", + "position": { + "x": 3075.214622199453, + "y": 64.1413418154358 + }, + "type": "notes", + "data": { + "id": "Agama-note-65eb07be-d51a-4e6a-a761-7a8d9ff3c46c", + "type": "Agama-note", + "notes": "Check that everything is correct", + "position": { + "x": 3075.214622199453, + "y": 64.1413418154358 + } + }, + "selected": true, + "positionAbsolute": { + "x": 3075.214622199453, + "y": 64.1413418154358 + }, + "dragging": false + }, + { + "width": 250, + "height": 30, + "id": "Agama-note-072abc49-d9d0-4d1b-8a0b-f71ea897d403", + "position": { + "x": 2874.4801077240713, + "y": 440.29940129438 + }, + "type": "notes", + "data": { + "id": "Agama-note-072abc49-d9d0-4d1b-8a0b-f71ea897d403", + "type": "Agama-note", + "notes": "If the count is greeter than 0", + "position": { + "x": 2874.4801077240713, + "y": 440.29940129438 + } + }, + "selected": false, + "positionAbsolute": { + "x": 2874.4801077240713, + "y": 440.29940129438 + }, + "dragging": false + }, + { + "width": 219, + "height": 30, + "id": "Agama-note-9d025b3f-d4fa-4d9d-ab54-08bf982b524d", + "position": { + "x": 1693.7232875744899, + "y": 230.5033389021968 + }, + "type": "notes", + "data": { + "id": "Agama-note-9d025b3f-d4fa-4d9d-ab54-08bf982b524d", + "type": "Agama-note", + "notes": "When user data is not null", + "position": { + "x": 1693.7232875744899, + "y": 230.5033389021968 + } + }, + "selected": false, + "positionAbsolute": { + "x": 1693.7232875744899, + "y": 230.5033389021968 + }, + "dragging": false + }, { "width": 170, "height": 124, @@ -362,7 +437,7 @@ }, "skake": false }, - "selected": true, + "selected": false, "dragging": false, "positionAbsolute": { "x": 3701, @@ -454,8 +529,8 @@ "height": 60, "id": "Agama-when-Node-f506e361-5ab3-499c-bb6b-e0ccc49e5ad1", "position": { - "x": 2866, - "y": 532 + "x": 2945.606987758962, + "y": 533.6021397551792 }, "parentId": "Agama-log-Node-59c922ed-bca1-43ac-b92d-5961edac11f0", "type": "when", @@ -466,8 +541,8 @@ "whenCondition": "", "inRepeatBlock": true, "position": { - "x": 2866, - "y": 532 + "x": 2945.606987758962, + "y": 533.6021397551792 }, "agamaData": { "id": "Agama-when-Node-f506e361-5ab3-499c-bb6b-e0ccc49e5ad1", @@ -505,8 +580,8 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 2866, - "y": 532 + "x": 2945.606987758962, + "y": 533.6021397551792 } }, { @@ -748,7 +823,7 @@ "id": "Agama-when-Node-ebb3dc63-b8f3-4405-b1cc-4c3c541feadc", "position": { "x": 1718, - "y": 311 + "y": 310.4714909797193 }, "parentId": "Agama-assignment-Node-5f55bd0a-21ad-4368-8d20-d3073122fa3c", "type": "when", @@ -760,7 +835,7 @@ "inRepeatBlock": true, "position": { "x": 1718, - "y": 311 + "y": 310.4714909797193 }, "agamaData": { "id": "Agama-when-Node-ebb3dc63-b8f3-4405-b1cc-4c3c541feadc", @@ -801,7 +876,7 @@ "dragging": false, "positionAbsolute": { "x": 1718, - "y": 311 + "y": 310.4714909797193 } }, { @@ -810,7 +885,7 @@ "id": "Agama-call-Node-fb1ad7aa-2953-4c81-8231-e6cb5636a7e0", "position": { "x": 1124, - "y": 258 + "y": 257.47149097971936 }, "type": "call", "data": { @@ -821,7 +896,7 @@ "inRepeatBlock": true, "position": { "x": 1124, - "y": 258 + "y": 257.47149097971936 }, "agamaData": { "id": "Agama-call-Node-fb1ad7aa-2953-4c81-8231-e6cb5636a7e0", @@ -879,7 +954,7 @@ "dragging": false, "positionAbsolute": { "x": 1124, - "y": 258 + "y": 257.47149097971936 } }, { @@ -1728,7 +1803,7 @@ "id": "Agama-assignment-Node-5f55bd0a-21ad-4368-8d20-d3073122fa3c", "position": { "x": 1517, - "y": 259 + "y": 258.4714909797193 }, "type": "assignment", "data": { @@ -1739,7 +1814,7 @@ "inRepeatBlock": "", "position": { "x": 1517, - "y": 259 + "y": 258.4714909797193 }, "agamaData": { "id": "Agama-assignment-Node-5f55bd0a-21ad-4368-8d20-d3073122fa3c", @@ -1797,7 +1872,7 @@ "dragging": false, "positionAbsolute": { "x": 1517, - "y": 259 + "y": 258.4714909797193 }, "parentId": "Agama-log-Node-b731280f-7322-49ff-b8ea-052cc933a0ba", "whenCondition": "", @@ -2228,8 +2303,8 @@ } ], "viewport": { - "x": -7720.558026915904, - "y": -857.462372734504, - "zoom": 2 + "x": -2021.6066717391855, + "y": -44.292635527397124, + "zoom": 0.870550563296124 } } \ No newline at end of file From b3b2066c606a482620df90768c98b6af680c1796 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:26:09 -0400 Subject: [PATCH 10/90] feat: update org.gluu.agama.securitykey.main.flow --- code/org.gluu.agama.securitykey.main.flow | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/org.gluu.agama.securitykey.main.flow b/code/org.gluu.agama.securitykey.main.flow index e8e97f8..c5fe1d7 100644 --- a/code/org.gluu.agama.securitykey.main.flow +++ b/code/org.gluu.agama.securitykey.main.flow @@ -24,5 +24,5 @@ Repeat 3 times max // Set the loginForm success field to false loginForm.success = false // When the maximum number of attempts has been made, the flow will end. -it_bmqcr = {success:false, error: "Login attempt exceeded."} -Finish it_bmqcr \ No newline at end of file +it_ebpuk = {success:false, error: "Login attempt exceeded."} +Finish it_ebpuk \ No newline at end of file From b85cd6a13e6a3c8b0234d952f6e1e35a4f78bdc2 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:28:31 -0400 Subject: [PATCH 11/90] feat: update project.json From 64492ff876039a91fafedb3b54badbdfb1555654 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:28:32 -0400 Subject: [PATCH 12/90] feat: update org.gluu.agama.securitykey.main.json --- code/org.gluu.agama.securitykey.main.json | 29 +++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/code/org.gluu.agama.securitykey.main.json b/code/org.gluu.agama.securitykey.main.json index 0fc85d8..2a02824 100644 --- a/code/org.gluu.agama.securitykey.main.json +++ b/code/org.gluu.agama.securitykey.main.json @@ -5,8 +5,8 @@ "height": 30, "id": "Agama-note-65eb07be-d51a-4e6a-a761-7a8d9ff3c46c", "position": { - "x": 3075.214622199453, - "y": 64.1413418154358 + "x": 3835.6529332074906, + "y": 381.1820877946175 }, "type": "notes", "data": { @@ -14,14 +14,15 @@ "type": "Agama-note", "notes": "Check that everything is correct", "position": { - "x": 3075.214622199453, - "y": 64.1413418154358 - } + "x": 3835.6529332074906, + "y": 381.1820877946175 + }, + "skake": false }, - "selected": true, + "selected": false, "positionAbsolute": { - "x": 3075.214622199453, - "y": 64.1413418154358 + "x": 3835.6529332074906, + "y": 381.1820877946175 }, "dragging": false }, @@ -41,7 +42,8 @@ "position": { "x": 2874.4801077240713, "y": 440.29940129438 - } + }, + "skake": false }, "selected": false, "positionAbsolute": { @@ -66,7 +68,8 @@ "position": { "x": 1693.7232875744899, "y": 230.5033389021968 - } + }, + "skake": false }, "selected": false, "positionAbsolute": { @@ -2303,8 +2306,8 @@ } ], "viewport": { - "x": -2021.6066717391855, - "y": -44.292635527397124, - "zoom": 0.870550563296124 + "x": -1522.1505084644582, + "y": -103.05887200624647, + "zoom": 0.6241652744508059 } } \ No newline at end of file From 4b01f8518c2d8b7be02458b3ce4a4e0fab55babe Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:28:34 -0400 Subject: [PATCH 13/90] feat: update org.gluu.agama.securitykey.main.flow --- code/org.gluu.agama.securitykey.main.flow | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/org.gluu.agama.securitykey.main.flow b/code/org.gluu.agama.securitykey.main.flow index c5fe1d7..83986b9 100644 --- a/code/org.gluu.agama.securitykey.main.flow +++ b/code/org.gluu.agama.securitykey.main.flow @@ -24,5 +24,5 @@ Repeat 3 times max // Set the loginForm success field to false loginForm.success = false // When the maximum number of attempts has been made, the flow will end. -it_ebpuk = {success:false, error: "Login attempt exceeded."} -Finish it_ebpuk \ No newline at end of file +it_wizqv = {success:false, error: "Login attempt exceeded."} +Finish it_wizqv \ No newline at end of file From cef272c5a348e856d6d3de571fbf00243b990854 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:03:12 -0400 Subject: [PATCH 14/90] feat: update project.json From abde8f7fb3b09f70432f0fbe77463dcaee41312f Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:03:14 -0400 Subject: [PATCH 15/90] feat: update org.gluu.agama.securitykey.main.json --- code/org.gluu.agama.securitykey.main.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/org.gluu.agama.securitykey.main.json b/code/org.gluu.agama.securitykey.main.json index 2a02824..6f7d721 100644 --- a/code/org.gluu.agama.securitykey.main.json +++ b/code/org.gluu.agama.securitykey.main.json @@ -138,7 +138,7 @@ "logLevel": "", "assignCallbackResult": "", "displayName": "LoginForm set false", - "nodeColor": "", + "nodeColor": "#eb999a", "exceptionVariableField": "", "hasExtraData": false, "configParams": "{}", @@ -146,7 +146,7 @@ }, "skake": false }, - "selected": false, + "selected": true, "dragging": false, "positionAbsolute": { "x": 1983, @@ -511,7 +511,7 @@ "logLevel": "", "assignCallbackResult": "", "displayName": "Finish count 0", - "nodeColor": "", + "nodeColor": "#eb999a", "exceptionVariableField": "", "finishMode": "withFailure", "hasExtraData": false, @@ -2306,8 +2306,8 @@ } ], "viewport": { - "x": -1522.1505084644582, - "y": -103.05887200624647, - "zoom": 0.6241652744508059 + "x": 413.7518603249657, + "y": -36.78984558399344, + "zoom": 0.8705505632961246 } } \ No newline at end of file From 8a459e2737afedd08860570e0f2307c82b0ee229 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:03:16 -0400 Subject: [PATCH 16/90] feat: update org.gluu.agama.securitykey.main.flow --- code/org.gluu.agama.securitykey.main.flow | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/org.gluu.agama.securitykey.main.flow b/code/org.gluu.agama.securitykey.main.flow index 83986b9..05fe082 100644 --- a/code/org.gluu.agama.securitykey.main.flow +++ b/code/org.gluu.agama.securitykey.main.flow @@ -24,5 +24,5 @@ Repeat 3 times max // Set the loginForm success field to false loginForm.success = false // When the maximum number of attempts has been made, the flow will end. -it_wizqv = {success:false, error: "Login attempt exceeded."} -Finish it_wizqv \ No newline at end of file +it_erzmc = {success:false, error: "Login attempt exceeded."} +Finish it_erzmc \ No newline at end of file From 34a5878d6b8bee23ea36454143e4663e78cb2f23 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:04:55 -0400 Subject: [PATCH 17/90] feat: update project.json From 2154cfa4559aa31334811846d61ea456bf6a846f Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:04:57 -0400 Subject: [PATCH 18/90] feat: update org.gluu.agama.securitykey.fidoAuthn.json --- .../org.gluu.agama.securitykey.fidoAuthn.json | 49 +++++++++++-------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/code/org.gluu.agama.securitykey.fidoAuthn.json b/code/org.gluu.agama.securitykey.fidoAuthn.json index dedb604..5570310 100644 --- a/code/org.gluu.agama.securitykey.fidoAuthn.json +++ b/code/org.gluu.agama.securitykey.fidoAuthn.json @@ -2,7 +2,7 @@ "nodes": [ { "width": 170, - "height": 122, + "height": 124, "id": "finish-2a56b16a-c2c1-41af-ae9b-a13af37a9d0a", "position": { "x": 1685, @@ -79,7 +79,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-call-Node-1aeb4a1a-0c47-4fe9-8e9d-ce6078806f5b", "position": { "x": 1485, @@ -149,7 +149,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "finish-de636519-7305-41a5-89ae-c11536a5c7e1", "position": { "x": 1486, @@ -220,7 +220,7 @@ }, "skake": false }, - "selected": true, + "selected": false, "positionAbsolute": { "x": 1486, "y": 232 @@ -228,8 +228,8 @@ "dragging": false }, { - "width": 210, - "height": 140, + "width": 110, + "height": 60, "id": "Agama-when-Node-0a9b8e2a-907c-447a-b594-37a311fc7d2c", "position": { "x": 1235, @@ -264,7 +264,15 @@ "valueField": "\"\"", "hasComment": true, "hasSuccess": true, - "hasFailure": true + "hasFailure": true, + "conditions": [ + { + "variable": "obj.skipped", + "operator": "is", + "dataValue": "\"\"", + "combinator": "none" + } + ] }, "handles": [ "Agama-when-Node-0a9b8e2a-907c-447a-b594-37a311fc7d2c.FAILURE", @@ -281,7 +289,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-rrf-Node-3bf36af3-e361-4efa-855b-a2309c79a796", "position": { "x": 1030, @@ -357,7 +365,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-assignment-Node-7d6402d1-120f-498c-b174-77079338be46", "position": { "x": 830, @@ -432,7 +440,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-call-Node-76a3dde3-a6d8-402e-b411-d6835539ea6b", "position": { "x": 630, @@ -508,7 +516,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-call-Node-1d2f9128-9f25-4431-82d3-131b569ce7e3", "position": { "x": 430, @@ -584,7 +592,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-log-Node-33b6b4ce-5a64-42ae-bec5-5d4e945ef211", "position": { "x": 230, @@ -615,7 +623,7 @@ "parentId": "Agama-start-Flow-b152daa8-8e5d-4204-9518-3c11143edcfc", "name": "", "basepath": "", - "comment": "", + "comment": "Mark log started", "notes": "", "flowfilename": "", "assignments": [ @@ -650,7 +658,7 @@ }, "skake": false }, - "selected": false, + "selected": true, "positionAbsolute": { "x": 230, "y": 28 @@ -659,7 +667,7 @@ }, { "width": 170, - "height": 122, + "height": 124, "id": "Agama-start-Flow-b152daa8-8e5d-4204-9518-3c11143edcfc", "type": "start", "sourcePosition": "right", @@ -683,7 +691,7 @@ "inRepeatBlock": false, "name": "", "basepath": "", - "comment": "", + "comment": "This flow is responsible for validation with the security key device", "notes": "", "flowfilename": "", "assignments": [ @@ -716,7 +724,8 @@ "configParams": "{}", "flowname": "org.gluu.agama.securitykey.fidoAuthn", "nodeIcon": "material-symbols:line-start-square", - "inputs": "userData withEscape" + "inputs": "userData withEscape", + "timeout": "" }, "skake": false }, @@ -907,8 +916,8 @@ } ], "viewport": { - "x": -1053, - "y": 23, - "zoom": 1 + "x": -273.16666666666674, + "y": 53, + "zoom": 2 } } \ No newline at end of file From 8896ab7fc8f208d4d401adc52ba8fd24c409c5cb Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:04:58 -0400 Subject: [PATCH 19/90] feat: update org.gluu.agama.securitykey.fidoAuthn.flow --- code/org.gluu.agama.securitykey.fidoAuthn.flow | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/org.gluu.agama.securitykey.fidoAuthn.flow b/code/org.gluu.agama.securitykey.fidoAuthn.flow index ea35b36..4ea805c 100644 --- a/code/org.gluu.agama.securitykey.fidoAuthn.flow +++ b/code/org.gluu.agama.securitykey.fidoAuthn.flow @@ -1,12 +1,16 @@ +// This flow is responsible for validation with the security key device Flow org.gluu.agama.securitykey.fidoAuthn Basepath "" Inputs userData withEscape +// Mark log started Log "@debug Fido Authn flow started!" -jose = Call org.gluu.agama.securitykey.authn.FidoValidator#new +jose = Call org.gluu.agama.securitykey.authn.FidoValidator#new assertion = Call jose assertionRequest userData.uid obj = { name: userData.name, escape: withEscape, assertion: assertion } obj = RRF "fido-authn.ftlh" obj When obj.skipped is "" - Finish false + it_kcyoq = {success:false, error: "false"} + Finish it_kcyoq obj = Call jose verify obj.tokenResponse -Finish true \ No newline at end of file +it_dgezg = {success:false, error: "true"} +Finish it_dgezg \ No newline at end of file From d42608f5d85adc08821c0c0bc01b78700fd1c909 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:10:38 -0400 Subject: [PATCH 20/90] feat: update project.json From 34daa5d737c6f4a737568eae051f44cc1df509c4 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:10:40 -0400 Subject: [PATCH 21/90] feat: update org.gluu.agama.securitykey.fidoAuthn.json --- .../org.gluu.agama.securitykey.fidoAuthn.json | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/code/org.gluu.agama.securitykey.fidoAuthn.json b/code/org.gluu.agama.securitykey.fidoAuthn.json index 5570310..2c16136 100644 --- a/code/org.gluu.agama.securitykey.fidoAuthn.json +++ b/code/org.gluu.agama.securitykey.fidoAuthn.json @@ -320,7 +320,7 @@ "parentId": "Agama-assignment-Node-7d6402d1-120f-498c-b174-77079338be46", "name": "", "basepath": "", - "comment": "", + "comment": "Load fido-authn page and pass \"obj\"", "notes": "", "flowfilename": "", "assignments": [ @@ -331,7 +331,9 @@ } ], "callType": "Call static method", - "arguments": "obj", + "arguments": [ + "obj" + ], "logMessage": "", "templatePath": "fido-authn.ftlh", "maxIteration": "", @@ -396,7 +398,7 @@ "parentId": "Agama-call-Node-76a3dde3-a6d8-402e-b411-d6835539ea6b", "name": "", "basepath": "", - "comment": "", + "comment": "\"obj\" variable declaration to be sent to validation view", "notes": "", "flowfilename": "", "assignments": [ @@ -443,7 +445,7 @@ "height": 124, "id": "Agama-call-Node-76a3dde3-a6d8-402e-b411-d6835539ea6b", "position": { - "x": 630, + "x": 629, "y": 27 }, "type": "call", @@ -454,7 +456,7 @@ "whenCondition": "", "inRepeatBlock": false, "position": { - "x": 630, + "x": 629, "y": 27 }, "agamaData": { @@ -471,7 +473,7 @@ "parentId": "Agama-call-Node-1d2f9128-9f25-4431-82d3-131b569ce7e3", "name": "", "basepath": "", - "comment": "", + "comment": "Generates the assertionRequest record to initiate validation", "notes": "", "flowfilename": "", "assignments": [ @@ -510,7 +512,7 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 630, + "x": 629, "y": 27 } }, @@ -520,7 +522,7 @@ "id": "Agama-call-Node-1d2f9128-9f25-4431-82d3-131b569ce7e3", "position": { "x": 430, - "y": 28 + "y": 27.5 }, "type": "call", "data": { @@ -531,7 +533,7 @@ "inRepeatBlock": false, "position": { "x": 430, - "y": 28 + "y": 27.5 }, "agamaData": { "id": "Agama-call-Node-1d2f9128-9f25-4431-82d3-131b569ce7e3", @@ -547,7 +549,7 @@ "parentId": "Agama-log-Node-33b6b4ce-5a64-42ae-bec5-5d4e945ef211", "name": "", "basepath": "", - "comment": "", + "comment": "Get instance FidoValidator", "notes": "", "flowfilename": "", "assignments": [ @@ -587,7 +589,7 @@ "dragging": false, "positionAbsolute": { "x": 430, - "y": 28 + "y": 27.5 } }, { @@ -623,7 +625,7 @@ "parentId": "Agama-start-Flow-b152daa8-8e5d-4204-9518-3c11143edcfc", "name": "", "basepath": "", - "comment": "Mark log started", + "comment": "Mark startup logs", "notes": "", "flowfilename": "", "assignments": [ @@ -658,7 +660,7 @@ }, "skake": false }, - "selected": true, + "selected": false, "positionAbsolute": { "x": 230, "y": 28 @@ -916,8 +918,8 @@ } ], "viewport": { - "x": -273.16666666666674, - "y": 53, + "x": -1860.5, + "y": 81.66666666666663, "zoom": 2 } } \ No newline at end of file From 5cf44bba4c4282665df964449dcc6db9f69a127d Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:10:41 -0400 Subject: [PATCH 22/90] feat: update org.gluu.agama.securitykey.fidoAuthn.flow --- code/org.gluu.agama.securitykey.fidoAuthn.flow | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/code/org.gluu.agama.securitykey.fidoAuthn.flow b/code/org.gluu.agama.securitykey.fidoAuthn.flow index 4ea805c..2960584 100644 --- a/code/org.gluu.agama.securitykey.fidoAuthn.flow +++ b/code/org.gluu.agama.securitykey.fidoAuthn.flow @@ -2,15 +2,19 @@ Flow org.gluu.agama.securitykey.fidoAuthn Basepath "" Inputs userData withEscape -// Mark log started +// Mark startup logs Log "@debug Fido Authn flow started!" +// Get instance FidoValidator jose = Call org.gluu.agama.securitykey.authn.FidoValidator#new +// Generates the assertionRequest record to initiate validation assertion = Call jose assertionRequest userData.uid +// "obj" variable declaration to be sent to validation view obj = { name: userData.name, escape: withEscape, assertion: assertion } +// Load fido-authn page and pass "obj" obj = RRF "fido-authn.ftlh" obj When obj.skipped is "" - it_kcyoq = {success:false, error: "false"} - Finish it_kcyoq + it_vmygv = {success:false, error: "false"} + Finish it_vmygv obj = Call jose verify obj.tokenResponse -it_dgezg = {success:false, error: "true"} -Finish it_dgezg \ No newline at end of file +it_nwmgj = {success:false, error: "true"} +Finish it_nwmgj \ No newline at end of file From 2e789143ed0053241ed445d513c614a2bf628a20 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:19:49 -0400 Subject: [PATCH 23/90] feat: update project.json From bbba525f15a53c2974132e8b438e263d0a273929 Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:19:51 -0400 Subject: [PATCH 24/90] feat: update org.gluu.agama.securitykey.fidoAuthn.json --- .../org.gluu.agama.securitykey.fidoAuthn.json | 47 +++++++++++++++---- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/code/org.gluu.agama.securitykey.fidoAuthn.json b/code/org.gluu.agama.securitykey.fidoAuthn.json index 2c16136..2bc3590 100644 --- a/code/org.gluu.agama.securitykey.fidoAuthn.json +++ b/code/org.gluu.agama.securitykey.fidoAuthn.json @@ -1,5 +1,30 @@ { "nodes": [ + { + "width": 270, + "height": 68, + "id": "Agama-note-b2a6b60c-094c-4cb6-aa8b-36ef4906592b", + "position": { + "x": 1181, + "y": -50 + }, + "type": "notes", + "data": { + "id": "Agama-note-b2a6b60c-094c-4cb6-aa8b-36ef4906592b", + "type": "Agama-note", + "notes": "If the customer cancels the validation process the flow ends, otherwise the validation flow continues.", + "position": { + "x": 1181, + "y": -50 + } + }, + "selected": true, + "positionAbsolute": { + "x": 1181, + "y": -50 + }, + "dragging": false + }, { "width": 170, "height": 124, @@ -34,7 +59,7 @@ "parentId": "Agama-call-Node-1aeb4a1a-0c47-4fe9-8e9d-ce6078806f5b", "name": "", "basepath": "", - "comment": "", + "comment": "Ends the flow correctly", "notes": "", "flowfilename": "", "assignments": [ @@ -110,12 +135,14 @@ "parentId": "Agama-when-Node-0a9b8e2a-907c-447a-b594-37a311fc7d2c", "name": "", "basepath": "", - "comment": "", + "comment": "Performs the verification after processing the security device", "notes": "", "flowfilename": "", "assignments": [], "callType": "Call method on instance", - "arguments": "obj.tokenResponse", + "arguments": [ + "obj.tokenResponse" + ], "logMessage": "", "templatePath": "", "maxIteration": "", @@ -211,7 +238,7 @@ "logLevel": "", "assignCallbackResult": "", "displayName": "Finish false", - "nodeColor": "", + "nodeColor": "#eb999a", "exceptionVariableField": "", "finishMode": "withFailure", "hasExtraData": false, @@ -232,7 +259,7 @@ "height": 60, "id": "Agama-when-Node-0a9b8e2a-907c-447a-b594-37a311fc7d2c", "position": { - "x": 1235, + "x": 1236.5, "y": 81 }, "parentId": "Agama-rrf-Node-3bf36af3-e361-4efa-855b-a2309c79a796", @@ -244,7 +271,7 @@ "whenCondition": "", "inRepeatBlock": false, "position": { - "x": 1235, + "x": 1236.5, "y": 81 }, "agamaData": { @@ -283,7 +310,7 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": 1235, + "x": 1236.5, "y": 81 } }, @@ -918,8 +945,8 @@ } ], "viewport": { - "x": -1860.5, - "y": 81.66666666666663, - "zoom": 2 + "x": 147.32377000284862, + "y": 131.7641905356587, + "zoom": 0.6241652744508059 } } \ No newline at end of file From 62139c319f450e4271df6e5a34aaef8f917f5cfc Mon Sep 17 00:00:00 2001 From: Milton Ch <86965029+Milton-Ch@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:19:52 -0400 Subject: [PATCH 25/90] feat: update org.gluu.agama.securitykey.fidoAuthn.flow --- code/org.gluu.agama.securitykey.fidoAuthn.flow | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/org.gluu.agama.securitykey.fidoAuthn.flow b/code/org.gluu.agama.securitykey.fidoAuthn.flow index 2960584..cf95097 100644 --- a/code/org.gluu.agama.securitykey.fidoAuthn.flow +++ b/code/org.gluu.agama.securitykey.fidoAuthn.flow @@ -13,8 +13,10 @@ obj = { name: userData.name, escape: withEscape, assertion: assertion } // Load fido-authn page and pass "obj" obj = RRF "fido-authn.ftlh" obj When obj.skipped is "" - it_vmygv = {success:false, error: "false"} - Finish it_vmygv + it_obhbo = {success:false, error: "false"} + Finish it_obhbo +// Performs the verification after processing the security device obj = Call jose verify obj.tokenResponse -it_nwmgj = {success:false, error: "true"} -Finish it_nwmgj \ No newline at end of file +// Ends the flow correctly +it_mdehp = {success:false, error: "true"} +Finish it_mdehp \ No newline at end of file From 490d3dbb05781c12e8efa0917850a4281debd626 Mon Sep 17 00:00:00 2001 From: Milton Ch Date: Thu, 4 Apr 2024 21:09:02 -0400 Subject: [PATCH 26/90] feat: update README.md Signed-off-by: Milton Ch --- README.md | 104 ++++++++++++++++-------------------------------------- 1 file changed, 30 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index a6cc3b7..05bb4a1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# Agama Security Key Project - [![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] @@ -7,78 +5,36 @@ [![Issues][issues-shield]][issues-url] [![Apache License][license-shield]][license-url] -Use this project to authenticate using security devices (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 `io.jans.agama.securitykey.main`) the user's browser is redirected -to a view where he/she must first enter his/her username, then validate one of the security keys that he/she has -configured for his/her user (Yubico Key, Windows Hello, Touch ID on Mac, etc.). Finally, the user's browser is -redirected to the registered URI. - -> **Note:** You must have registered security devices to your user, to register you must use **Jans Casa**. - -## Project Deployment - -To deploy this project we need to meet the requirements. - -### Requirements - -1. Running instance of `Jans Auth Server`, `Jans Fido2` and `Jans Casa` - -### Add Java dependencies - -1. Download - latest [agama-securitykey-custom.jar](https://github.com/GluuFederation/agama-security-key/releases/latest/download/agama-securitykey-custom.jar) - from [Releases](https://github.com/GluuFederation/agama-securitykey/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: +# Agama Security Key -``` - - /jans-auth - - /jans-auth.war - - true - - ... - /opt/jans/jetty/jans-auth/custom/libs/agama-securitykey-custom.jar, - ... - - -``` +Welcome to the https://github.com/GluuFederation/agama-securitykey project. This project is governed by Gluu and published under an Apache 2.0 license. -4. Restart Auth Server to load the new jar: +Use this project to add user authentication with **SecurityKey**(Yubico Key, Windows Hello, Touch ID on Mac, etc.) -``` -systemctl restart jans-auth -```` +For more information you can also see +* [What is FIDO](https://fidoalliance.org/what-is-fido/) +* [How FIDO Works](https://fidoalliance.org/how-fido-works/) +* [FIDO Specs](https://www.w3.org/TR/webauthn-1) -### Deployment +## Supported IDPs -Download the -latest [agama-securitykey.gama](https://github.com/GluuFederation/agama-securitykey/releases/latest/download/agama-securitykey.gama) -file and deploy it in Auth Sever. +| IDP | Description | +|:-----------------|:-------------------------------------------------------------------| +| Jans Auth Server | [Deployment instructions](https://docs.jans.io/head/admin/install) | +| Gluu Flex | [Deployment instructions](https://docs.gluu.org/head/install) | -Siga los siguientes pasos: +## Flows -- 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 +| Qualified Name | Description | +|----------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `org.gluu.agama.securitykey.main` | This is the main flow that you can start directly from the browser. To use this first flow, make sure you have at least one `security key` configured, this can be done from **JANS CASA**. In this first view you will only be asked for your username and then you will be redirected to the `org.gluu.agama.passkey.fidoAuthn` flow where the validation of your security key device will be done. | +| `org.gluu.agama.securitykey.fidoAuthn` | This flow is used to perform the `security key` validation, you have the option to cancel the process. If you complete the flow successfully, you will be granted access. | -![TUI_DEPLOY](https://github.com/GluuFederation/agama-securitykey/assets/86965029/de25752e-3c86-4c67-a890-2e78494e4c6c) +## Configuration -## Testing +This agama project does not need any additional configuration to run its flow. -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-securitykey** in action: +## Demo ![TEST_AGAMA_SECURITY_KEY](https://github.com/GluuFederation/agama-securitykey/assets/86965029/53baa0ab-d2d0-4e5f-a3c1-7c15c2dc48be) @@ -98,26 +54,26 @@ of **agama-securitykey** 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-securitykey/blob/main/LICENSE) -[contributors-shield]: https://img.shields.io/github/contributors/GluuFederation/agama-security-key.svg?style=for-the-badge +[contributors-shield]: https://img.shields.io/github/contributors/GluuFederation/agama-securitykey.svg?style=for-the-badge -[contributors-url]: https://github.com/GluuFederation/agama-security-key/graphs/contributors +[contributors-url]: https://github.com/GluuFederation/agama-securitykey/graphs/contributors -[forks-shield]: https://img.shields.io/github/forks/GluuFederation/agama-security-key.svg?style=for-the-badge +[forks-shield]: https://img.shields.io/github/forks/GluuFederation/agama-securitykey.svg?style=for-the-badge [forks-url]: https://github.com/GluuFederation/agama-security-key/network/members -[stars-shield]: https://img.shields.io/github/stars/GluuFederation/agama-security-key?style=for-the-badge +[stars-shield]: https://img.shields.io/github/stars/GluuFederation/agama-securitykey?style=for-the-badge -[stars-url]: https://github.com/GluuFederation/agama-security-key/stargazers +[stars-url]: https://github.com/GluuFederation/agama-securitykey/stargazers -[issues-shield]: https://img.shields.io/github/issues/GluuFederation/agama-security-key.svg?style=for-the-badge +[issues-shield]: https://img.shields.io/github/issues/GluuFederation/agama-securitykey.svg?style=for-the-badge -[issues-url]: https://github.com/GluuFederation/agama-security-key/issues +[issues-url]: https://github.com/GluuFederation/agama-securitykey/issues -[license-shield]: https://img.shields.io/github/license/GluuFederation/agama-security-key.svg?style=for-the-badge +[license-shield]: https://img.shields.io/github/license/GluuFederation/agama-securitykey.svg?style=for-the-badge -[license-url]: https://github.com/GluuFederation/agama-security-key/blob/master/LICENSE +[license-url]: https://github.com/GluuFederation/agama-securitykey/blob/master/LICENSE From 1be097edc50635f34c3f2d23bdb1c79f3aa709f5 Mon Sep 17 00:00:00 2001 From: madhu1310 <55378018+madhu1310@users.noreply.github.com> Date: Fri, 26 Apr 2024 23:05:08 +0530 Subject: [PATCH 27/90] feat: update main.ftlh --- web/main.ftlh | 56 +++++++-------------------------------------------- 1 file changed, 7 insertions(+), 49 deletions(-) diff --git a/web/main.ftlh b/web/main.ftlh index ca69209..5442040 100644 --- a/web/main.ftlh +++ b/web/main.ftlh @@ -1,18 +1,14 @@ - - - - - - - - - -
-
- -
- -
-
-

Welcome to Agama SecurityKey

- - - -
-
- -
- -
-
-
-
- -
-
-
-
-
-
-
-
-
- - + \ No newline at end of file From 0c56c2fe9d685d466050a86d2144681f8c2a4fa3 Mon Sep 17 00:00:00 2001 From: madhu1310 <55378018+madhu1310@users.noreply.github.com> Date: Fri, 26 Apr 2024 23:05:31 +0530 Subject: [PATCH 28/90] feat: update main.ftlh --- web/main.ftlh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/main.ftlh b/web/main.ftlh index 5442040..3682cd0 100644 --- a/web/main.ftlh +++ b/web/main.ftlh @@ -2,7 +2,7 @@ -

Welcome to Agama SecurityKey


+

Login using a SecurityKey


- - - -
-
- -
- -
-
-

Insert and activate your security key

-
- -
- - - -
- -
-
-
-
-
-
-
- - - + \ No newline at end of file From 8a084ff99bc402f20d74f453b935689592227cbe Mon Sep 17 00:00:00 2001 From: madhu1310 <55378018+madhu1310@users.noreply.github.com> Date: Tue, 30 Apr 2024 21:56:39 +0530 Subject: [PATCH 30/90] feat: update main.ftlh --- web/main.ftlh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/main.ftlh b/web/main.ftlh index 3682cd0..2c04742 100644 --- a/web/main.ftlh +++ b/web/main.ftlh @@ -2,7 +2,7 @@ -

Login using a SecurityKey


+

Login