From f44c8bcbcc65e580b43e428d03b2d1297e21e422 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Fri, 10 Nov 2023 16:10:51 -0500 Subject: [PATCH] feat: publish agama-openid project --- code/io.jans.inbound.openid.flow | 10 + code/io.jans.inbound.openid.json | 602 +++++++++++++++++++++++++++++++ project.json | 3 +- 3 files changed, 614 insertions(+), 1 deletion(-) create mode 100644 code/io.jans.inbound.openid.flow create mode 100644 code/io.jans.inbound.openid.json diff --git a/code/io.jans.inbound.openid.flow b/code/io.jans.inbound.openid.flow new file mode 100644 index 0000000..399a9cb --- /dev/null +++ b/code/io.jans.inbound.openid.flow @@ -0,0 +1,10 @@ +// OpenId-based inbound identity flow +Flow io.jans.inbound.openid + Basepath "" + Configs conf +obj = Trigger io.jans.inbound.oauth2.AuthzCodeWithUserInfo conf.oidc +When obj.success is true + obj.data = obj.data.profile + uid = Call io.jans.inbound.UserOnboardHelper#exec conf.uidPrefix obj.data + Finish uid +Finish obj diff --git a/code/io.jans.inbound.openid.json b/code/io.jans.inbound.openid.json new file mode 100644 index 0000000..9e9d156 --- /dev/null +++ b/code/io.jans.inbound.openid.json @@ -0,0 +1,602 @@ +{ + "nodes": [ + { + "width": 170, + "height": 122, + "id": "finish-06b53209-be55-4ed6-91fd-098229606f8c", + "position": { + "x": 680, + "y": 30 + }, + "type": "finish", + "data": { + "id": "finish-06b53209-be55-4ed6-91fd-098229606f8c", + "type": "Agama-finish-Flow", + "parentId": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "handles": [ + "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7.FAILURE", + "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7.SUCCESS" + ], + "position": { + "x": 680, + "y": 30 + }, + "agamaData": { + "id": "finish-06b53209-be55-4ed6-91fd-098229606f8c", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "parentId": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7", + "name": "", + "basepath": "", + "comment": "Fail", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "obj", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:line-end-square-rounded" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 680, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "finish-ee6298f9-129a-4403-99ec-80e1d80c1020", + "position": { + "x": 943, + "y": 314 + }, + "type": "finish", + "data": { + "id": "finish-ee6298f9-129a-4403-99ec-80e1d80c1020", + "type": "Agama-finish-Flow", + "parentId": "Agama-call-Node-2be381f3-1640-4a0c-9746-9d95d31b58da", + "whenCondition": "", + "inRepeatBlock": false, + "handles": [], + "position": { + "x": 943, + "y": 314 + }, + "agamaData": { + "id": "finish-ee6298f9-129a-4403-99ec-80e1d80c1020", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-call-Node-2be381f3-1640-4a0c-9746-9d95d31b58da", + "name": "", + "basepath": "", + "comment": "Finish and authenticate the given user", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "uid", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:line-end-square-rounded" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 943, + "y": 314 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-call-Node-2be381f3-1640-4a0c-9746-9d95d31b58da", + "position": { + "x": 743, + "y": 314 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-2be381f3-1640-4a0c-9746-9d95d31b58da", + "type": "Agama-call-Node", + "parentId": "Agama-assignment-Node-eea337cf-2c1b-4f1a-9b87-0f524c0ccca3", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 743, + "y": 314 + }, + "agamaData": { + "id": "Agama-call-Node-2be381f3-1640-4a0c-9746-9d95d31b58da", + "type": "Agama-call-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-assignment-Node-eea337cf-2c1b-4f1a-9b87-0f524c0ccca3", + "name": "", + "basepath": "", + "comment": "Do user provisioning and grab his uid", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "conf.uidPrefix obj.data", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "io.jans.inbound.UserOnboardHelper", + "javaMethodName": "exec", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "uid" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 743, + "y": 314 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-assignment-Node-eea337cf-2c1b-4f1a-9b87-0f524c0ccca3", + "position": { + "x": 543, + "y": 314 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-eea337cf-2c1b-4f1a-9b87-0f524c0ccca3", + "type": "Agama-assignment-Node", + "parentId": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "position": { + "x": 543, + "y": 314 + }, + "agamaData": { + "id": "Agama-assignment-Node-eea337cf-2c1b-4f1a-9b87-0f524c0ccca3", + "type": "Agama-assignment-Node", + "hasSuccess": "", + "hasFailure": "", + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "parentId": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7", + "name": "", + "basepath": "", + "comment": "Leave token stuff aside", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "obj.data.profile", + "assignedVariableName": "obj.data" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:equal" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 543, + "y": 314 + } + }, + { + "width": 210, + "height": 140, + "id": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7", + "position": { + "x": 430, + "y": 84 + }, + "parentId": "Agama-trigger-Node-33f59113-bb1c-410e-a9e0-8de5a77beaa3", + "type": "when", + "data": { + "id": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7", + "type": "Agama-when-Node", + "parentId": "Agama-trigger-Node-33f59113-bb1c-410e-a9e0-8de5a77beaa3", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 430, + "y": 84 + }, + "agamaData": { + "id": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7", + "parentId": "Agama-trigger-Node-33f59113-bb1c-410e-a9e0-8de5a77beaa3", + "type": "Agama-when-Node", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "variableField": "obj.success", + "conditionInputField": "is", + "valueField": "true", + "comment": "subflow succeded?", + "hasSuccess": true, + "hasFailure": true + }, + "handles": [ + "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7.FAILURE", + "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7.SUCCESS" + ], + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 430, + "y": 84 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-trigger-Node-33f59113-bb1c-410e-a9e0-8de5a77beaa3", + "position": { + "x": 230, + "y": 30 + }, + "type": "trigger", + "data": { + "id": "Agama-trigger-Node-33f59113-bb1c-410e-a9e0-8de5a77beaa3", + "type": "Agama-trigger-Node", + "parentId": "Agama-start-Flow-de06b59c-fb82-4c9e-a1ca-306b167d07ac", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 230, + "y": 30 + }, + "agamaData": { + "id": "Agama-trigger-Node-33f59113-bb1c-410e-a9e0-8de5a77beaa3", + "type": "Agama-trigger-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-start-Flow-de06b59c-fb82-4c9e-a1ca-306b167d07ac", + "name": "", + "basepath": "", + "comment": "Launch utility flow", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "conf.oidc", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "fluent-mdl2:trigger-approval", + "flowFileName": "io.jans.inbound.oauth2.AuthzCodeWithUserInfo", + "asssignedVariableName": "obj" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 230, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-start-Flow-de06b59c-fb82-4c9e-a1ca-306b167d07ac", + "type": "start", + "sourcePosition": "right", + "data": { + "id": "Agama-start-Flow-de06b59c-fb82-4c9e-a1ca-306b167d07ac", + "type": "Agama-start-Flow", + "position": { + "x": 30, + "y": 30 + }, + "inRepeatBlock": false, + "agamaData": { + "id": "Agama-start-Flow-de06b59c-fb82-4c9e-a1ca-306b167d07ac", + "type": "Agama-start-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "inRepeatBlock": false, + "name": "", + "basepath": "", + "comment": "OpenId-based inbound identity flow", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "flowname": "io.jans.inbound.openid", + "nodeIcon": "material-symbols:line-start-square", + "configs": "conf", + "isTopLevelFlow": true, + "hasComment": true, + "configParams": "{\n \"oidc\":{\n \"authzEndpoint\":\"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenEndpoint\":\"https://oauth2.googleapis.com/token\",\n \"userInfoEndpoint\":\"https://openidconnect.googleapis.com/v1/userinfo\",\n \"clientId\":\"CLIENT IDENTIFIER\",\n \"clientSecret\":\"SECRET\",\n \"scopes\":[\"openid\"],\n \"clientCredsInRequestBody\":true,\n \"custParamsAuthReq\":{},\n \"custParamsTokenReq\":{}\n },\n \"uidPrefix\":\"google-\"\n}\n" + }, + "skake": false + }, + "position": { + "x": 30, + "y": 30 + }, + "selected": true, + "dragging": false, + "positionAbsolute": { + "x": 30, + "y": 30 + } + } + ], + "edges": [ + { + "id": "Agama-start-Flow-de06b59c-fb82-4c9e-a1ca-306b167d07ac-Agama-trigger-Node-33f59113-bb1c-410e-a9e0-8de5a77beaa3-785faa11-9bf4-44b1-9b4c-45012c327316", + "type": "straight", + "source": "Agama-start-Flow-de06b59c-fb82-4c9e-a1ca-306b167d07ac", + "target": "Agama-trigger-Node-33f59113-bb1c-410e-a9e0-8de5a77beaa3", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-trigger-Node-33f59113-bb1c-410e-a9e0-8de5a77beaa3-Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7-8cd6d2bf-6c37-4ebd-91ee-6213ee8c7de9", + "type": "straight", + "source": "Agama-trigger-Node-33f59113-bb1c-410e-a9e0-8de5a77beaa3", + "target": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7-Agama-assignment-Node-eea337cf-2c1b-4f1a-9b87-0f524c0ccca3-23c33e35-e8dc-4f06-9490-4038f9b9a79c", + "type": "straight", + "source": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7", + "target": "Agama-assignment-Node-eea337cf-2c1b-4f1a-9b87-0f524c0ccca3", + "label": "Condition met", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7.SUCCESS" + }, + { + "id": "Agama-assignment-Node-eea337cf-2c1b-4f1a-9b87-0f524c0ccca3-Agama-call-Node-2be381f3-1640-4a0c-9746-9d95d31b58da-b5b72660-42a5-4c1b-95e7-abdfba77d5d4", + "type": "straight", + "source": "Agama-assignment-Node-eea337cf-2c1b-4f1a-9b87-0f524c0ccca3", + "target": "Agama-call-Node-2be381f3-1640-4a0c-9746-9d95d31b58da", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-2be381f3-1640-4a0c-9746-9d95d31b58da-finish-ee6298f9-129a-4403-99ec-80e1d80c1020-22706074-2bff-4e8f-8f1f-83a1f7ae6615", + "type": "straight", + "source": "Agama-call-Node-2be381f3-1640-4a0c-9746-9d95d31b58da", + "target": "finish-ee6298f9-129a-4403-99ec-80e1d80c1020", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7-finish-06b53209-be55-4ed6-91fd-098229606f8c-b72ffd54-3f7b-46a0-b5b1-726dbcb365c1", + "type": "straight", + "source": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7", + "target": "finish-06b53209-be55-4ed6-91fd-098229606f8c", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-5116b663-2b53-471f-b693-faecfd9dd2a7.FAILURE" + } + ], + "viewport": { + "x": 22, + "y": 71, + "zoom": 1 + } +} diff --git a/project.json b/project.json index 7aaf703..a893212 100644 --- a/project.json +++ b/project.json @@ -9,7 +9,8 @@ "license": "apache-2.0", "lastUpdated": "1699278900783", "tags": [ - "openid-connect" + "openid-connect", + "jans" ], "noDirectLaunch": [], "configs": {}