From ebebfde0defb916589615f22972e8adf32fc18d5 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Fri, 10 Nov 2023 15:47:46 -0500 Subject: [PATCH] feat: publish agama-openid project --- LICENSE | 202 +++ README.md | 42 + code/README.md | 1 + code/io.jans.inbound.oauth2.AuthzCode.flow | 21 + code/io.jans.inbound.oauth2.AuthzCode.json | 1485 +++++++++++++++++ ....inbound.oauth2.AuthzCodeWithUserInfo.flow | 16 + ....inbound.oauth2.AuthzCodeWithUserInfo.json | 1177 +++++++++++++ code/io.jans.inbound.oidc_code.flow | 10 + code/io.jans.inbound.oidc_code.json | 602 +++++++ lib/README.md | 1 + lib/io/README.md | 1 + lib/io/jans/README.md | 1 + lib/io/jans/inbound/README.md | 1 + lib/io/jans/inbound/UserOnboardHelper.java | 37 + project.json | 16 + web/README.md | 1 + 16 files changed, 3614 insertions(+) create mode 100644 LICENSE create mode 100644 code/README.md create mode 100644 code/io.jans.inbound.oauth2.AuthzCode.flow create mode 100644 code/io.jans.inbound.oauth2.AuthzCode.json create mode 100644 code/io.jans.inbound.oauth2.AuthzCodeWithUserInfo.flow create mode 100644 code/io.jans.inbound.oauth2.AuthzCodeWithUserInfo.json create mode 100644 code/io.jans.inbound.oidc_code.flow create mode 100644 code/io.jans.inbound.oidc_code.json create mode 100644 lib/README.md create mode 100644 lib/io/README.md create mode 100644 lib/io/jans/README.md create mode 100644 lib/io/jans/inbound/README.md create mode 100644 lib/io/jans/inbound/UserOnboardHelper.java create mode 100644 project.json create mode 100644 web/README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index e69de29..171baae 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,42 @@ +### oidc-auth + +Authentication using an external OpenID Connect provider with the _code_ flow + +Here's an example (Google) of how the configuration properties of flow `io.jans.inbound.oidc_code` may look like for actual deployment + +``` + { + "oidc": { + "authzEndpoint": "https://accounts.google.com/o/oauth2/v2/auth", + "tokenEndpoint": "https://oauth2.googleapis.com/token", + "userInfoEndpoint": "https://openidconnect.googleapis.com/v1/userinfo", + "clientId": "--- FILL YOUR VALUE HERE ---", + "clientSecret": "--- FILL YOUR VALUE HERE ---", + "scopes": ["openid", "email", "profile"], + "clientCredsInRequestBody": true, + "custParamsAuthReq": {}, + "custParamsTokenReq": {} + }, + "uidPrefix": "google-" +} +``` + +Structure of `oidc` property is described below: + + +|Name|Description| +|-|-| +|`authzEndpoint`|The authorization endpoint as in section 3.1 of [RFC 7649](https://www.ietf.org/rfc/rfc6749)| +|`tokenEndpoint`|The token endpoint as in section 3.2 of [RFC 7649](https://www.ietf.org/rfc/rfc6749)| +|`userInfoEndpoint`|The endpoint where profile data can be retrieved. This is not part of the OAuth2 specification| +|`clientId`|The identifier of the client to use, see section 1.1 and 2.2 of [RFC 7649](https://www.ietf.org/rfc/rfc6749). This client is assumed to be *confidential* as in section 2.1| +|`clientSecret`|Secret associated to the client| +|`scopes`|A JSON array of strings that represent the scopes of the access tokens to retrieve| +|`redirectUri`|Redirect URI as in section 3.1.2 of [RFC 7649](https://www.ietf.org/rfc/rfc6749)| +|`clientCredsInRequestBody`|`true` indicates the client authenticates at the token endpoint by including the credentials in the body of the request, otherwise, HTTP Basic authentication is assumed. See section 2.3.1 of [RFC 7649](https://www.ietf.org/rfc/rfc6749)| +|`custParamsAuthReq`|A JSON object (keys and values expected to be strings) with extra parameters to pass to the authorization endpoint if desired| +|`custParamsTokenReq`|A JSON object (keys and values expected to be strings) with extra parameters to pass to the token endpoint if desired| + +Often, the first six properties are the only needed. + +When generating client ID and secret at the external OP, provide for redirect URI the following: `https:///jans-auth/fl/callback` diff --git a/code/README.md b/code/README.md new file mode 100644 index 0000000..d476de1 --- /dev/null +++ b/code/README.md @@ -0,0 +1 @@ +### Code folder \ No newline at end of file diff --git a/code/io.jans.inbound.oauth2.AuthzCode.flow b/code/io.jans.inbound.oauth2.AuthzCode.flow new file mode 100644 index 0000000..9938149 --- /dev/null +++ b/code/io.jans.inbound.oauth2.AuthzCode.flow @@ -0,0 +1,21 @@ +// OAuth 2.0 code flow +Flow io.jans.inbound.oauth2.AuthzCode + Basepath "" + Inputs oauthParams +When oauthParams.redirectUri is null + issuer = Call io.jans.util.NetworkUtils#urlBeforeContextPath + list = [ issuer, "/jans-auth/fl/callback" ] + oauthParams.redirectUri = Call java.lang.String#join "" list +codeGrantUtil = Call io.jans.inbound.oauth2.CodeGrantUtil#new oauthParams +Log "@info Creating an authorization request" +url = Call codeGrantUtil makeAuthzRequest +state = url.second +url = url.first +Log "@info Redirecting to external site" +responseParams = RFAC url +Log "@info Browser taken back to redirect URI" +code = Call codeGrantUtil parseCode responseParams state +response = Call codeGrantUtil getTokenResponse code +Log "@info An access token has been obtained" +obj = { success: true, data: response } +Finish obj diff --git a/code/io.jans.inbound.oauth2.AuthzCode.json b/code/io.jans.inbound.oauth2.AuthzCode.json new file mode 100644 index 0000000..407443a --- /dev/null +++ b/code/io.jans.inbound.oauth2.AuthzCode.json @@ -0,0 +1,1485 @@ +{ + "nodes": [ + { + "width": 170, + "height": 122, + "id": "finish-0c14af69-b38f-4fd9-8674-e6ad333a09fb", + "position": { + "x": 2677.3463097188055, + "y": 30 + }, + "type": "finish", + "data": { + "id": "finish-0c14af69-b38f-4fd9-8674-e6ad333a09fb", + "type": "Agama-finish-Flow", + "parentId": "Agama-assignment-Node-39faf81b-4892-4791-a83c-c58e1c1694f2", + "whenCondition": "", + "inRepeatBlock": false, + "handles": [], + "position": { + "x": 2677.3463097188055, + "y": 30 + }, + "agamaData": { + "id": "finish-0c14af69-b38f-4fd9-8674-e6ad333a09fb", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-assignment-Node-39faf81b-4892-4791-a83c-c58e1c1694f2", + "name": "", + "basepath": "", + "comment": "", + "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": 2677.3463097188055, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-assignment-Node-39faf81b-4892-4791-a83c-c58e1c1694f2", + "position": { + "x": 2477.3463097188055, + "y": 30 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-39faf81b-4892-4791-a83c-c58e1c1694f2", + "type": "Agama-assignment-Node", + "parentId": "Agama-log-Node-1b18c8be-d439-4e53-a98f-ced4f65635e2", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 2477.3463097188055, + "y": 30 + }, + "agamaData": { + "id": "Agama-assignment-Node-39faf81b-4892-4791-a83c-c58e1c1694f2", + "type": "Agama-assignment-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-log-Node-1b18c8be-d439-4e53-a98f-ced4f65635e2", + "name": "", + "basepath": "", + "comment": "", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "{ success: true, data: response }", + "assignedVariableName": "obj" + } + ], + "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": 2477.3463097188055, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-log-Node-1b18c8be-d439-4e53-a98f-ced4f65635e2", + "position": { + "x": 2277.3463097188055, + "y": 30 + }, + "type": "log", + "data": { + "id": "Agama-log-Node-1b18c8be-d439-4e53-a98f-ced4f65635e2", + "type": "Agama-log-Node", + "parentId": "Agama-call-Node-3ef557f0-7054-47ea-89af-e121e142ffec", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 2277.3463097188055, + "y": 30 + }, + "agamaData": { + "id": "Agama-log-Node-1b18c8be-d439-4e53-a98f-ced4f65635e2", + "type": "Agama-log-Node", + "hasSuccess": "", + "hasFailure": "", + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-call-Node-3ef557f0-7054-47ea-89af-e121e142ffec", + "name": "", + "basepath": "", + "comment": "", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "\"An access token has been obtained\"", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "info", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "octicon:log-16" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2277.3463097188055, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-call-Node-3ef557f0-7054-47ea-89af-e121e142ffec", + "position": { + "x": 2077.3463097188055, + "y": 30 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-3ef557f0-7054-47ea-89af-e121e142ffec", + "type": "Agama-call-Node", + "parentId": "Agama-call-Node-5a900c87-e381-4782-91f9-b3d4c5aa279f", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 2077.3463097188055, + "y": 30 + }, + "agamaData": { + "id": "Agama-call-Node-3ef557f0-7054-47ea-89af-e121e142ffec", + "type": "Agama-call-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-call-Node-5a900c87-e381-4782-91f9-b3d4c5aa279f", + "name": "", + "basepath": "", + "comment": "Grab tokens - response variable looks like in sect 4.1.4 of RFC 6749", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call method on instance", + "arguments": "code", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "getTokenResponse", + "javaVariableName": "codeGrantUtil", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "response" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2077.3463097188055, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-call-Node-5a900c87-e381-4782-91f9-b3d4c5aa279f", + "position": { + "x": 1877.3463097188055, + "y": 30 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-5a900c87-e381-4782-91f9-b3d4c5aa279f", + "type": "Agama-call-Node", + "parentId": "Agama-log-Node-ddb4d193-7689-46f2-a5c2-6892c9bd8866", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1877.3463097188055, + "y": 30 + }, + "agamaData": { + "id": "Agama-call-Node-5a900c87-e381-4782-91f9-b3d4c5aa279f", + "type": "Agama-call-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-log-Node-ddb4d193-7689-46f2-a5c2-6892c9bd8866", + "name": "", + "basepath": "", + "comment": "Parse code presented at callback uri", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call method on instance", + "arguments": "responseParams state", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "parseCode", + "javaVariableName": "codeGrantUtil", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "code" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1877.3463097188055, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-log-Node-ddb4d193-7689-46f2-a5c2-6892c9bd8866", + "position": { + "x": 1677.3463097188055, + "y": 30 + }, + "type": "log", + "data": { + "id": "Agama-log-Node-ddb4d193-7689-46f2-a5c2-6892c9bd8866", + "type": "Agama-log-Node", + "parentId": "Agama-rfac-Node-303b28aa-50ec-44fa-b389-394dee60d024", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1677.3463097188055, + "y": 30 + }, + "agamaData": { + "id": "Agama-log-Node-ddb4d193-7689-46f2-a5c2-6892c9bd8866", + "type": "Agama-log-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-rfac-Node-303b28aa-50ec-44fa-b389-394dee60d024", + "name": "", + "basepath": "", + "comment": "", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "\"Browser taken back to redirect URI\"", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "info", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "octicon:log-16" + }, + "skake": false + }, + "selected": false, + "positionAbsolute": { + "x": 1677.3463097188055, + "y": 30 + }, + "dragging": false + }, + { + "width": 170, + "height": 122, + "id": "Agama-rfac-Node-303b28aa-50ec-44fa-b389-394dee60d024", + "position": { + "x": 1480, + "y": 30 + }, + "type": "rfac", + "data": { + "id": "Agama-rfac-Node-303b28aa-50ec-44fa-b389-394dee60d024", + "type": "Agama-rfac-Node", + "parentId": "Agama-log-Node-57779dd8-99ef-4a05-b14d-e5f5ca4a9f35", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1480, + "y": 30 + }, + "agamaData": { + "id": "Agama-rfac-Node-303b28aa-50ec-44fa-b389-394dee60d024", + "type": "Agama-rfac-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-log-Node-57779dd8-99ef-4a05-b14d-e5f5ca4a9f35", + "name": "", + "basepath": "", + "comment": "Redirect to external OP", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "url", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "responseParams", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "ic:baseline-insert-link" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1480, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-log-Node-57779dd8-99ef-4a05-b14d-e5f5ca4a9f35", + "position": { + "x": 1280, + "y": 30 + }, + "type": "log", + "data": { + "id": "Agama-log-Node-57779dd8-99ef-4a05-b14d-e5f5ca4a9f35", + "type": "Agama-log-Node", + "parentId": "Agama-assignment-Node-60f38cac-9aca-47cd-9634-b74d31d10956", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1280, + "y": 30 + }, + "agamaData": { + "id": "Agama-log-Node-57779dd8-99ef-4a05-b14d-e5f5ca4a9f35", + "type": "Agama-log-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-assignment-Node-60f38cac-9aca-47cd-9634-b74d31d10956", + "name": "", + "basepath": "", + "comment": "", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "\"Redirecting to external site\"", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "info", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "octicon:log-16" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1280, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-assignment-Node-60f38cac-9aca-47cd-9634-b74d31d10956", + "position": { + "x": 1080, + "y": 30 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-60f38cac-9aca-47cd-9634-b74d31d10956", + "type": "Agama-assignment-Node", + "parentId": "Agama-call-Node-72476312-8d8f-4b4c-86de-6421f0ffd1a8", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1080, + "y": 30 + }, + "agamaData": { + "id": "Agama-assignment-Node-60f38cac-9aca-47cd-9634-b74d31d10956", + "type": "Agama-assignment-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-call-Node-72476312-8d8f-4b4c-86de-6421f0ffd1a8", + "name": "", + "basepath": "", + "comment": "Extract URL and generated state", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "url.second", + "assignedVariableName": "state" + }, + { + "variableTypeCheck": false, + "assignmentExpression": "url.first", + "assignedVariableName": "url" + } + ], + "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": 1080, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-call-Node-72476312-8d8f-4b4c-86de-6421f0ffd1a8", + "position": { + "x": 880, + "y": 30 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-72476312-8d8f-4b4c-86de-6421f0ffd1a8", + "type": "Agama-call-Node", + "parentId": "Agama-log-Node-679f999c-6a6b-45b1-ba34-279e2521ac7c", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 880, + "y": 30 + }, + "agamaData": { + "id": "Agama-call-Node-72476312-8d8f-4b4c-86de-6421f0ffd1a8", + "type": "Agama-call-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-log-Node-679f999c-6a6b-45b1-ba34-279e2521ac7c", + "name": "", + "basepath": "", + "comment": "Generate authorization request", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call method on instance", + "arguments": "", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "makeAuthzRequest", + "javaVariableName": "codeGrantUtil", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "url" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 880, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-log-Node-679f999c-6a6b-45b1-ba34-279e2521ac7c", + "position": { + "x": 680, + "y": 30 + }, + "type": "log", + "data": { + "id": "Agama-log-Node-679f999c-6a6b-45b1-ba34-279e2521ac7c", + "type": "Agama-log-Node", + "parentId": "Agama-call-Node-95483ea0-4434-4311-ae3d-434a30b6d723", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 680, + "y": 30 + }, + "agamaData": { + "id": "Agama-log-Node-679f999c-6a6b-45b1-ba34-279e2521ac7c", + "type": "Agama-log-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-call-Node-95483ea0-4434-4311-ae3d-434a30b6d723", + "name": "", + "basepath": "", + "comment": "", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "\"Creating an authorization request\"", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "info", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "octicon:log-16" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 680, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-call-Node-95483ea0-4434-4311-ae3d-434a30b6d723", + "position": { + "x": 480, + "y": 30 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-95483ea0-4434-4311-ae3d-434a30b6d723", + "type": "Agama-call-Node", + "parentId": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "position": { + "x": 480, + "y": 30 + }, + "agamaData": { + "id": "Agama-call-Node-95483ea0-4434-4311-ae3d-434a30b6d723", + "type": "Agama-call-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "parentId": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57", + "name": "", + "basepath": "", + "comment": "Instantiate code grant utility", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Create an instance", + "arguments": "oauthParams", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "io.jans.inbound.oauth2.CodeGrantUtil", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "codeGrantUtil" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 480, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-call-Node-2eb4f4be-7f58-4c69-9c90-2fe17fdbe02d", + "position": { + "x": 743, + "y": 314 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-2eb4f4be-7f58-4c69-9c90-2fe17fdbe02d", + "type": "Agama-call-Node", + "parentId": "Agama-assignment-Node-33c9eb04-e4c2-4ae1-a9db-ab3ceff5ba42", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 743, + "y": 314 + }, + "agamaData": { + "id": "Agama-call-Node-2eb4f4be-7f58-4c69-9c90-2fe17fdbe02d", + "type": "Agama-call-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-assignment-Node-33c9eb04-e4c2-4ae1-a9db-ab3ceff5ba42", + "name": "", + "basepath": "", + "comment": "Build redirect uri", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "\"\" list", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "java.lang.String", + "javaMethodName": "join", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "oauthParams.redirectUri" + }, + "skake": false + }, + "selected": true, + "dragging": false, + "positionAbsolute": { + "x": 743, + "y": 314 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-assignment-Node-33c9eb04-e4c2-4ae1-a9db-ab3ceff5ba42", + "position": { + "x": 543, + "y": 314 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-33c9eb04-e4c2-4ae1-a9db-ab3ceff5ba42", + "type": "Agama-assignment-Node", + "parentId": "Agama-call-Node-cb9d7bc4-7c56-478a-a0d8-f5ac7bcefce1", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 543, + "y": 314 + }, + "agamaData": { + "id": "Agama-assignment-Node-33c9eb04-e4c2-4ae1-a9db-ab3ceff5ba42", + "type": "Agama-assignment-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-call-Node-cb9d7bc4-7c56-478a-a0d8-f5ac7bcefce1", + "name": "", + "basepath": "", + "comment": "", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "[ issuer, \"/jans-auth/fl/callback\" ]", + "assignedVariableName": "list" + } + ], + "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": 170, + "height": 122, + "id": "Agama-call-Node-cb9d7bc4-7c56-478a-a0d8-f5ac7bcefce1", + "position": { + "x": 343, + "y": 314 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-cb9d7bc4-7c56-478a-a0d8-f5ac7bcefce1", + "type": "Agama-call-Node", + "parentId": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57", + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "position": { + "x": 343, + "y": 314 + }, + "agamaData": { + "id": "Agama-call-Node-cb9d7bc4-7c56-478a-a0d8-f5ac7bcefce1", + "type": "Agama-call-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "parentId": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57", + "name": "", + "basepath": "", + "comment": "Obtain hostname from HTTP url", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "io.jans.util.NetworkUtils", + "javaMethodName": "urlBeforeContextPath", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "issuer" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 343, + "y": 314 + } + }, + { + "width": 210, + "height": 140, + "id": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57", + "position": { + "x": 230, + "y": 84 + }, + "parentId": "Agama-start-Flow-0102c357-a53f-496c-ae34-bcca2c3a07b5", + "type": "when", + "data": { + "id": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57", + "type": "Agama-when-Node", + "parentId": "Agama-start-Flow-0102c357-a53f-496c-ae34-bcca2c3a07b5", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 230, + "y": 84 + }, + "agamaData": { + "id": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57", + "parentId": "Agama-start-Flow-0102c357-a53f-496c-ae34-bcca2c3a07b5", + "type": "Agama-when-Node", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "variableField": "oauthParams.redirectUri", + "conditionInputField": "is", + "valueField": "null", + "comment": "If redirect uri is not defined use agama's default", + "hasSuccess": true, + "hasFailure": true + }, + "handles": [ + "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57.FAILURE", + "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57.SUCCESS" + ], + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 230, + "y": 84 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-start-Flow-0102c357-a53f-496c-ae34-bcca2c3a07b5", + "type": "start", + "sourcePosition": "right", + "data": { + "id": "Agama-start-Flow-0102c357-a53f-496c-ae34-bcca2c3a07b5", + "type": "Agama-start-Flow", + "position": { + "x": 30, + "y": 30 + }, + "inRepeatBlock": false, + "agamaData": { + "id": "Agama-start-Flow-0102c357-a53f-496c-ae34-bcca2c3a07b5", + "type": "Agama-start-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "inRepeatBlock": false, + "name": "", + "basepath": "", + "comment": "OAuth 2.0 code 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.oauth2.AuthzCode", + "nodeIcon": "material-symbols:line-start-square", + "inputs": "oauthParams", + "isTopLevelFlow": false, + "hasComment": true + }, + "skake": false + }, + "position": { + "x": 30, + "y": 30 + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 30, + "y": 30 + } + } + ], + "edges": [ + { + "id": "Agama-start-Flow-0102c357-a53f-496c-ae34-bcca2c3a07b5-Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57-1aad8d2c-5820-44a1-bb35-a5688d327499", + "type": "straight", + "source": "Agama-start-Flow-0102c357-a53f-496c-ae34-bcca2c3a07b5", + "target": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57-Agama-call-Node-cb9d7bc4-7c56-478a-a0d8-f5ac7bcefce1-d79ef63c-0028-48d4-b987-8aab612f535e", + "type": "straight", + "source": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57", + "target": "Agama-call-Node-cb9d7bc4-7c56-478a-a0d8-f5ac7bcefce1", + "label": "Condition met", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57.SUCCESS" + }, + { + "id": "Agama-call-Node-cb9d7bc4-7c56-478a-a0d8-f5ac7bcefce1-Agama-assignment-Node-33c9eb04-e4c2-4ae1-a9db-ab3ceff5ba42-e0b6a1fc-3d28-43e8-aa02-14c640936a60", + "type": "straight", + "source": "Agama-call-Node-cb9d7bc4-7c56-478a-a0d8-f5ac7bcefce1", + "target": "Agama-assignment-Node-33c9eb04-e4c2-4ae1-a9db-ab3ceff5ba42", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-assignment-Node-33c9eb04-e4c2-4ae1-a9db-ab3ceff5ba42-Agama-call-Node-2eb4f4be-7f58-4c69-9c90-2fe17fdbe02d-44853d3c-5f47-4177-b33a-e4b770c4933c", + "type": "straight", + "source": "Agama-assignment-Node-33c9eb04-e4c2-4ae1-a9db-ab3ceff5ba42", + "target": "Agama-call-Node-2eb4f4be-7f58-4c69-9c90-2fe17fdbe02d", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57-Agama-call-Node-95483ea0-4434-4311-ae3d-434a30b6d723-21c03ce9-a17d-4efd-b3d1-d28922531b9b", + "type": "straight", + "source": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57", + "target": "Agama-call-Node-95483ea0-4434-4311-ae3d-434a30b6d723", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-e0a3ca22-b0d1-4bf1-9111-a4114b5b0d57.FAILURE" + }, + { + "id": "Agama-call-Node-95483ea0-4434-4311-ae3d-434a30b6d723-Agama-log-Node-679f999c-6a6b-45b1-ba34-279e2521ac7c-7c7b2843-1b11-47b6-b4cd-1d8c746d1265", + "type": "straight", + "source": "Agama-call-Node-95483ea0-4434-4311-ae3d-434a30b6d723", + "target": "Agama-log-Node-679f999c-6a6b-45b1-ba34-279e2521ac7c", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-log-Node-679f999c-6a6b-45b1-ba34-279e2521ac7c-Agama-call-Node-72476312-8d8f-4b4c-86de-6421f0ffd1a8-ef8b306e-8248-4dfa-bb79-98e83e2fdaa0", + "type": "straight", + "source": "Agama-log-Node-679f999c-6a6b-45b1-ba34-279e2521ac7c", + "target": "Agama-call-Node-72476312-8d8f-4b4c-86de-6421f0ffd1a8", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-72476312-8d8f-4b4c-86de-6421f0ffd1a8-Agama-assignment-Node-60f38cac-9aca-47cd-9634-b74d31d10956-6122ef3a-e28d-4d2a-8873-87ce39537779", + "type": "straight", + "source": "Agama-call-Node-72476312-8d8f-4b4c-86de-6421f0ffd1a8", + "target": "Agama-assignment-Node-60f38cac-9aca-47cd-9634-b74d31d10956", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-assignment-Node-60f38cac-9aca-47cd-9634-b74d31d10956-Agama-log-Node-57779dd8-99ef-4a05-b14d-e5f5ca4a9f35-5fbac456-9ebe-4280-bc81-f7bbf948dc94", + "type": "straight", + "source": "Agama-assignment-Node-60f38cac-9aca-47cd-9634-b74d31d10956", + "target": "Agama-log-Node-57779dd8-99ef-4a05-b14d-e5f5ca4a9f35", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-log-Node-57779dd8-99ef-4a05-b14d-e5f5ca4a9f35-Agama-rfac-Node-303b28aa-50ec-44fa-b389-394dee60d024-373356fc-4bdb-42d4-8d52-6934618d6abf", + "type": "straight", + "source": "Agama-log-Node-57779dd8-99ef-4a05-b14d-e5f5ca4a9f35", + "target": "Agama-rfac-Node-303b28aa-50ec-44fa-b389-394dee60d024", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-rfac-Node-303b28aa-50ec-44fa-b389-394dee60d024-Agama-log-Node-ddb4d193-7689-46f2-a5c2-6892c9bd8866-f0739212-02e9-4dd7-ac29-8a7a57e8cf98", + "type": "straight", + "source": "Agama-rfac-Node-303b28aa-50ec-44fa-b389-394dee60d024", + "target": "Agama-log-Node-ddb4d193-7689-46f2-a5c2-6892c9bd8866", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-log-Node-ddb4d193-7689-46f2-a5c2-6892c9bd8866-Agama-call-Node-5a900c87-e381-4782-91f9-b3d4c5aa279f-122ab907-89e0-4d61-b4e5-d0b239427bee", + "type": "straight", + "source": "Agama-log-Node-ddb4d193-7689-46f2-a5c2-6892c9bd8866", + "target": "Agama-call-Node-5a900c87-e381-4782-91f9-b3d4c5aa279f", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-5a900c87-e381-4782-91f9-b3d4c5aa279f-Agama-call-Node-3ef557f0-7054-47ea-89af-e121e142ffec-29bd6a45-79ca-4191-9604-66bb08f3f4e0", + "type": "straight", + "source": "Agama-call-Node-5a900c87-e381-4782-91f9-b3d4c5aa279f", + "target": "Agama-call-Node-3ef557f0-7054-47ea-89af-e121e142ffec", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-3ef557f0-7054-47ea-89af-e121e142ffec-Agama-log-Node-1b18c8be-d439-4e53-a98f-ced4f65635e2-3730c66a-cb23-4571-ab9c-0eb4f7a87a32", + "type": "straight", + "source": "Agama-call-Node-3ef557f0-7054-47ea-89af-e121e142ffec", + "target": "Agama-log-Node-1b18c8be-d439-4e53-a98f-ced4f65635e2", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-log-Node-1b18c8be-d439-4e53-a98f-ced4f65635e2-Agama-assignment-Node-39faf81b-4892-4791-a83c-c58e1c1694f2-744b0d36-7ed0-441b-9422-896384aa3bc4", + "type": "straight", + "source": "Agama-log-Node-1b18c8be-d439-4e53-a98f-ced4f65635e2", + "target": "Agama-assignment-Node-39faf81b-4892-4791-a83c-c58e1c1694f2", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-assignment-Node-39faf81b-4892-4791-a83c-c58e1c1694f2-finish-0c14af69-b38f-4fd9-8674-e6ad333a09fb-a35e0467-4261-4485-95ea-e80d0b7f262f", + "type": "straight", + "source": "Agama-assignment-Node-39faf81b-4892-4791-a83c-c58e1c1694f2", + "target": "finish-0c14af69-b38f-4fd9-8674-e6ad333a09fb", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + } + ], + "viewport": { + "x": -228.78421125242107, + "y": -45.67481167937109, + "zoom": 0.7536674547791904 + } +} diff --git a/code/io.jans.inbound.oauth2.AuthzCodeWithUserInfo.flow b/code/io.jans.inbound.oauth2.AuthzCodeWithUserInfo.flow new file mode 100644 index 0000000..43649f1 --- /dev/null +++ b/code/io.jans.inbound.oauth2.AuthzCodeWithUserInfo.flow @@ -0,0 +1,16 @@ +// Runs the auth code flow and retrieves user profile data +Flow io.jans.inbound.oauth2.AuthzCodeWithUserInfo + Basepath "" + Inputs oauthParams +obj = Trigger io.jans.inbound.oauth2.AuthzCode oauthParams +token = obj.data.access_token +p | E = Call io.jans.util.NetworkUtils#mapFromGetRequestWithToken oauthParams.userInfoEndpoint token +When E is not null + Log "@error " E + msg = [ "Unable to retrieve user profile.", E.message ] + msg = Call java.lang.String#join " " msg + obj = { success: false, error: msg } + Finish obj +Log "@debug Profile data\n" p +obj = { success: true, data: { profile: p, tokenResponse: obj.data } } +Finish obj diff --git a/code/io.jans.inbound.oauth2.AuthzCodeWithUserInfo.json b/code/io.jans.inbound.oauth2.AuthzCodeWithUserInfo.json new file mode 100644 index 0000000..00aaaf4 --- /dev/null +++ b/code/io.jans.inbound.oauth2.AuthzCodeWithUserInfo.json @@ -0,0 +1,1177 @@ +{ + "nodes": [ + { + "width": 170, + "height": 122, + "id": "finish-81a0e39f-7257-4c3e-86b3-56495ce09e42", + "position": { + "x": 1480, + "y": 30 + }, + "type": "finish", + "data": { + "id": "finish-81a0e39f-7257-4c3e-86b3-56495ce09e42", + "type": "Agama-finish-Flow", + "parentId": "Agama-assignment-Node-8e2f456a-5f7f-4db6-9116-f88e3e95ae0a", + "whenCondition": "", + "inRepeatBlock": false, + "handles": [], + "position": { + "x": 1480, + "y": 30 + }, + "agamaData": { + "id": "finish-81a0e39f-7257-4c3e-86b3-56495ce09e42", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-assignment-Node-8e2f456a-5f7f-4db6-9116-f88e3e95ae0a", + "name": "", + "basepath": "", + "comment": "OK", + "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": 1480, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-assignment-Node-8e2f456a-5f7f-4db6-9116-f88e3e95ae0a", + "position": { + "x": 1280, + "y": 30 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-8e2f456a-5f7f-4db6-9116-f88e3e95ae0a", + "type": "Agama-assignment-Node", + "parentId": "Agama-log-Node-59696223-8faa-4a3c-8a6d-5c706fa96dcf", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1280, + "y": 30 + }, + "agamaData": { + "id": "Agama-assignment-Node-8e2f456a-5f7f-4db6-9116-f88e3e95ae0a", + "type": "Agama-assignment-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-log-Node-59696223-8faa-4a3c-8a6d-5c706fa96dcf", + "name": "", + "basepath": "", + "comment": "Build variable with profile and token data", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "{ success: true, data: { profile: p, tokenResponse: obj.data } }", + "assignedVariableName": "obj" + } + ], + "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": 1280, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-log-Node-59696223-8faa-4a3c-8a6d-5c706fa96dcf", + "position": { + "x": 1080, + "y": 30 + }, + "type": "log", + "data": { + "id": "Agama-log-Node-59696223-8faa-4a3c-8a6d-5c706fa96dcf", + "type": "Agama-log-Node", + "parentId": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "position": { + "x": 1080, + "y": 30 + }, + "agamaData": { + "id": "Agama-log-Node-59696223-8faa-4a3c-8a6d-5c706fa96dcf", + "type": "Agama-log-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "WhenFalse", + "inRepeatBlock": false, + "parentId": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "name": "", + "basepath": "", + "comment": "Dump profile data", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "\"Profile data\\n\" p", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "debug", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "octicon:log-16" + }, + "skake": false + }, + "positionAbsolute": { + "x": 1080, + "y": 30 + }, + "selected": false, + "dragging": false + }, + { + "width": 170, + "height": 122, + "id": "finish-a426566b-8d13-4da5-8e73-7a3af6332d06", + "position": { + "x": 1743, + "y": 314 + }, + "type": "finish", + "data": { + "id": "finish-a426566b-8d13-4da5-8e73-7a3af6332d06", + "type": "Agama-finish-Flow", + "parentId": "Agama-assignment-Node-3b3fc547-3933-4b17-9d25-584ffea9f0b0", + "whenCondition": "", + "inRepeatBlock": false, + "handles": [], + "position": { + "x": 1893, + "y": 314 + }, + "agamaData": { + "id": "finish-a426566b-8d13-4da5-8e73-7a3af6332d06", + "type": "Agama-finish-Flow", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-assignment-Node-3b3fc547-3933-4b17-9d25-584ffea9f0b0", + "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": 1743, + "y": 314 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-assignment-Node-3b3fc547-3933-4b17-9d25-584ffea9f0b0", + "position": { + "x": 1543, + "y": 314 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-3b3fc547-3933-4b17-9d25-584ffea9f0b0", + "type": "Agama-assignment-Node", + "parentId": "Agama-call-Node-0e3153cf-a7d5-4bfb-adb1-1c1e4c7e09d6", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1693, + "y": 314 + }, + "agamaData": { + "id": "Agama-assignment-Node-3b3fc547-3933-4b17-9d25-584ffea9f0b0", + "type": "Agama-assignment-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-call-Node-0e3153cf-a7d5-4bfb-adb1-1c1e4c7e09d6", + "name": "", + "basepath": "", + "comment": "", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "{ success: false, error: msg }", + "assignedVariableName": "obj" + } + ], + "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": 1543, + "y": 314 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-call-Node-0e3153cf-a7d5-4bfb-adb1-1c1e4c7e09d6", + "position": { + "x": 1343, + "y": 314 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-0e3153cf-a7d5-4bfb-adb1-1c1e4c7e09d6", + "type": "Agama-call-Node", + "parentId": "Agama-assignment-Node-8c1f10a5-f53f-4029-877b-868afd6db7d6", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1493, + "y": 314 + }, + "agamaData": { + "id": "Agama-call-Node-0e3153cf-a7d5-4bfb-adb1-1c1e4c7e09d6", + "type": "Agama-call-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-assignment-Node-8c1f10a5-f53f-4029-877b-868afd6db7d6", + "name": "", + "basepath": "", + "comment": "Generate error message", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "\" \" msg", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "java.lang.String", + "javaMethodName": "join", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "msg" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1343, + "y": 314 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-assignment-Node-8c1f10a5-f53f-4029-877b-868afd6db7d6", + "position": { + "x": 1143, + "y": 314 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-8c1f10a5-f53f-4029-877b-868afd6db7d6", + "type": "Agama-assignment-Node", + "parentId": "Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 1293, + "y": 314 + }, + "agamaData": { + "id": "Agama-assignment-Node-8c1f10a5-f53f-4029-877b-868afd6db7d6", + "type": "Agama-assignment-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a", + "name": "", + "basepath": "", + "comment": "", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "[ \"Unable to retrieve user profile.\", E.message ]", + "assignedVariableName": "msg" + } + ], + "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": 1143, + "y": 314 + } + }, + { + "width": 210, + "height": 140, + "id": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "position": { + "x": 830, + "y": 84 + }, + "parentId": "Agama-call-Node-42ba4dbe-515f-4df8-aa6b-4c7568b8451a", + "type": "when", + "data": { + "id": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "type": "Agama-when-Node", + "parentId": "Agama-call-Node-42ba4dbe-515f-4df8-aa6b-4c7568b8451a", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 830, + "y": 84 + }, + "agamaData": { + "id": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "parentId": "Agama-call-Node-42ba4dbe-515f-4df8-aa6b-4c7568b8451a", + "type": "Agama-when-Node", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "variableField": "E", + "conditionInputField": "is not", + "valueField": "null", + "comment": "Check if exception was thrown previously", + "hasSuccess": "", + "hasFailure": true, + "hasNoRepeat": false, + "hasRepeat": false + }, + "handles": [ + "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab.FAILURE", + "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab.SUCCESS" + ], + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 830, + "y": 84 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-call-Node-42ba4dbe-515f-4df8-aa6b-4c7568b8451a", + "position": { + "x": 630, + "y": 30 + }, + "type": "call", + "data": { + "id": "Agama-call-Node-42ba4dbe-515f-4df8-aa6b-4c7568b8451a", + "type": "Agama-call-Node", + "parentId": "Agama-assignment-Node-658c681c-5bc8-4d76-8e6e-4e1f7c25c0f2", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 630, + "y": 30 + }, + "agamaData": { + "id": "Agama-call-Node-42ba4dbe-515f-4df8-aa6b-4c7568b8451a", + "type": "Agama-call-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-assignment-Node-658c681c-5bc8-4d76-8e6e-4e1f7c25c0f2", + "name": "", + "basepath": "", + "comment": "Calls the userinfo endpoint and parses the request as a map", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "oauthParams.userInfoEndpoint token", + "logMessage": "", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "io.jans.util.NetworkUtils", + "javaMethodName": "mapFromGetRequestWithToken", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "E", + "nodeIcon": "material-symbols:code", + "asssignedVariableName": "p" + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 630, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-assignment-Node-658c681c-5bc8-4d76-8e6e-4e1f7c25c0f2", + "position": { + "x": 430, + "y": 30 + }, + "type": "assignment", + "data": { + "id": "Agama-assignment-Node-658c681c-5bc8-4d76-8e6e-4e1f7c25c0f2", + "type": "Agama-assignment-Node", + "parentId": "Agama-trigger-Node-149f6fac-d657-4f0f-8c29-f57a24489609", + "whenCondition": "", + "inRepeatBlock": false, + "position": { + "x": 430, + "y": 30 + }, + "agamaData": { + "id": "Agama-assignment-Node-658c681c-5bc8-4d76-8e6e-4e1f7c25c0f2", + "type": "Agama-assignment-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "", + "inRepeatBlock": false, + "parentId": "Agama-trigger-Node-149f6fac-d657-4f0f-8c29-f57a24489609", + "name": "", + "basepath": "", + "comment": "Extract access token", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": false, + "assignmentExpression": "obj.data.access_token", + "assignedVariableName": "token" + } + ], + "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": 430, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-trigger-Node-149f6fac-d657-4f0f-8c29-f57a24489609", + "position": { + "x": 230, + "y": 30 + }, + "type": "trigger", + "data": { + "id": "Agama-trigger-Node-149f6fac-d657-4f0f-8c29-f57a24489609", + "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-149f6fac-d657-4f0f-8c29-f57a24489609", + "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": "Launches the code flow", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "oauthParams", + "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.AuthzCode", + "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": "Runs the auth code flow and retrieves user profile data", + "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.oauth2.AuthzCodeWithUserInfo", + "nodeIcon": "material-symbols:line-start-square", + "inputs": "oauthParams", + "isTopLevelFlow": false, + "hasComment": true + }, + "skake": false + }, + "position": { + "x": 30, + "y": 30 + }, + "selected": true, + "dragging": false, + "positionAbsolute": { + "x": 30, + "y": 30 + } + }, + { + "width": 170, + "height": 122, + "id": "Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a", + "position": { + "x": 943, + "y": 314 + }, + "type": "log", + "data": { + "id": "Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a", + "type": "Agama-log-Node", + "parentId": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "whenCondition": "", + "inRepeatBlock": "", + "position": { + "x": 943, + "y": 314 + }, + "agamaData": { + "id": "Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a", + "type": "Agama-log-Node", + "hasSuccess": false, + "hasFailure": false, + "hasRepeat": false, + "hasNoRepeat": false, + "whenCondition": "WhenTrue", + "inRepeatBlock": false, + "parentId": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "name": "", + "basepath": "", + "comment": "Print stacktrace", + "notes": "", + "flowfilename": "", + "assignments": [ + { + "variableTypeCheck": true, + "assignmentExpression": "", + "assignedVariableName": "" + } + ], + "callType": "Call static method", + "arguments": "", + "logMessage": "E", + "templatePath": "", + "maxIteration": "", + "idpAuthEndpoint": "", + "variableField": "", + "conditionInputField": "", + "valueField": "", + "returnVariable": "", + "javaClassName": "", + "javaMethodName": "", + "javaVariableName": "", + "maxIterationVariableName": "", + "logLevel": "error", + "assignCallbackResult": "", + "displayName": "", + "nodeColor": "", + "exceptionVariableField": "", + "nodeIcon": "octicon:log-16", + "position": { + "x": 1243 + } + }, + "skake": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 943, + "y": 314 + }, + "parentId": "Agama-log-Node-5ccdfd33-81b8-4120-ad16-5088d3e92781", + "whenCondition": "", + "inRepeatBlock": "" + } + ], + "edges": [ + { + "id": "Agama-start-Flow-de06b59c-fb82-4c9e-a1ca-306b167d07ac-Agama-trigger-Node-149f6fac-d657-4f0f-8c29-f57a24489609-e1d07bf6-be7b-4907-946e-4b9462b2d263", + "type": "straight", + "source": "Agama-start-Flow-de06b59c-fb82-4c9e-a1ca-306b167d07ac", + "target": "Agama-trigger-Node-149f6fac-d657-4f0f-8c29-f57a24489609", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-trigger-Node-149f6fac-d657-4f0f-8c29-f57a24489609-Agama-when-Node-f8813b47-3c7c-4d57-8942-5623e05a90a5-796907c9-6b9c-4e30-9711-ffa36fc2e337", + "type": "straight", + "source": "Agama-trigger-Node-149f6fac-d657-4f0f-8c29-f57a24489609", + "target": "Agama-when-Node-f8813b47-3c7c-4d57-8942-5623e05a90a5", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-trigger-Node-149f6fac-d657-4f0f-8c29-f57a24489609-Agama-assignment-Node-658c681c-5bc8-4d76-8e6e-4e1f7c25c0f2-658f4cec-be56-44de-9a9a-4c7a9e803efb", + "type": "straight", + "source": "Agama-trigger-Node-149f6fac-d657-4f0f-8c29-f57a24489609", + "target": "Agama-assignment-Node-658c681c-5bc8-4d76-8e6e-4e1f7c25c0f2", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-assignment-Node-658c681c-5bc8-4d76-8e6e-4e1f7c25c0f2-Agama-call-Node-42ba4dbe-515f-4df8-aa6b-4c7568b8451a-e27192dd-90cb-4580-b5dd-2a088fbd6587", + "type": "straight", + "source": "Agama-assignment-Node-658c681c-5bc8-4d76-8e6e-4e1f7c25c0f2", + "target": "Agama-call-Node-42ba4dbe-515f-4df8-aa6b-4c7568b8451a", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-42ba4dbe-515f-4df8-aa6b-4c7568b8451a-Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab-3b8009c7-3b8f-446f-8283-cb6ceb00bc63", + "type": "straight", + "source": "Agama-call-Node-42ba4dbe-515f-4df8-aa6b-4c7568b8451a", + "target": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a-Agama-assignment-Node-8c1f10a5-f53f-4029-877b-868afd6db7d6-03c303fb-9223-4e34-8a56-c6d21ecfc786", + "type": "straight", + "source": "Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a", + "target": "Agama-assignment-Node-8c1f10a5-f53f-4029-877b-868afd6db7d6", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-assignment-Node-8c1f10a5-f53f-4029-877b-868afd6db7d6-Agama-call-Node-0e3153cf-a7d5-4bfb-adb1-1c1e4c7e09d6-6a64c2b1-9ce1-4b53-9389-a926bef2d830", + "type": "straight", + "source": "Agama-assignment-Node-8c1f10a5-f53f-4029-877b-868afd6db7d6", + "target": "Agama-call-Node-0e3153cf-a7d5-4bfb-adb1-1c1e4c7e09d6", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-call-Node-0e3153cf-a7d5-4bfb-adb1-1c1e4c7e09d6-Agama-assignment-Node-3b3fc547-3933-4b17-9d25-584ffea9f0b0-15a2ccbb-5209-43f9-b37d-1c06a55eddc5", + "type": "straight", + "source": "Agama-call-Node-0e3153cf-a7d5-4bfb-adb1-1c1e4c7e09d6", + "target": "Agama-assignment-Node-3b3fc547-3933-4b17-9d25-584ffea9f0b0", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-assignment-Node-3b3fc547-3933-4b17-9d25-584ffea9f0b0-finish-a426566b-8d13-4da5-8e73-7a3af6332d06-3eaa9ef2-74df-4523-929a-41fb9108e54f", + "type": "straight", + "source": "Agama-assignment-Node-3b3fc547-3933-4b17-9d25-584ffea9f0b0", + "target": "finish-a426566b-8d13-4da5-8e73-7a3af6332d06", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab-Agama-log-Node-5ccdfd33-81b8-4120-ad16-5088d3e92781-04157739-626b-4848-b77f-8fb2a48e3b4d", + "type": "straight", + "source": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "target": "Agama-log-Node-5ccdfd33-81b8-4120-ad16-5088d3e92781", + "label": "Condition met", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab.SUCCESS" + }, + { + "id": "Agama-log-Node-5ccdfd33-81b8-4120-ad16-5088d3e92781-Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a-e8a8e30d-dc80-4c6a-baf3-60e4f8683c37", + "type": "straight", + "source": "Agama-log-Node-5ccdfd33-81b8-4120-ad16-5088d3e92781", + "target": "Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "type": "straight", + "source": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "target": "Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a", + "id": "reactflow__edge-Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eabAgama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab.SUCCESS-Agama-log-Node-61e52b32-fe1c-4ebe-bb2c-df3087a16e3a", + "sourceHandle": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab.SUCCESS", + "targetHandle": null + }, + { + "id": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab-Agama-log-Node-59696223-8faa-4a3c-8a6d-5c706fa96dcf-effbc132-74ec-42e4-82e2-c0752869afef", + "type": "straight", + "source": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab", + "target": "Agama-log-Node-59696223-8faa-4a3c-8a6d-5c706fa96dcf", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + }, + "sourceHandle": "Agama-when-Node-c37faed6-e4ca-4a7c-bc3c-8f2fcdb34eab.FAILURE" + }, + { + "id": "Agama-log-Node-59696223-8faa-4a3c-8a6d-5c706fa96dcf-Agama-assignment-Node-8e2f456a-5f7f-4db6-9116-f88e3e95ae0a-bcf99a7e-7c37-4dc4-8004-19326e00d6ec", + "type": "straight", + "source": "Agama-log-Node-59696223-8faa-4a3c-8a6d-5c706fa96dcf", + "target": "Agama-assignment-Node-8e2f456a-5f7f-4db6-9116-f88e3e95ae0a", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + }, + { + "id": "Agama-assignment-Node-8e2f456a-5f7f-4db6-9116-f88e3e95ae0a-finish-81a0e39f-7257-4c3e-86b3-56495ce09e42-dc78497f-7595-4bc3-90d1-5230d7ca2d82", + "type": "straight", + "source": "Agama-assignment-Node-8e2f456a-5f7f-4db6-9116-f88e3e95ae0a", + "target": "finish-81a0e39f-7257-4c3e-86b3-56495ce09e42", + "label": "", + "labelBgPadding": [ + 8, + 4 + ], + "labelBgBorderRadius": 4, + "labelBgStyle": { + "fill": "#FFCC00", + "color": "#fff", + "fillOpacity": 0.7 + } + } + ], + "viewport": { + "x": 10, + "y": 15, + "zoom": 1 + } +} diff --git a/code/io.jans.inbound.oidc_code.flow b/code/io.jans.inbound.oidc_code.flow new file mode 100644 index 0000000..399a9cb --- /dev/null +++ b/code/io.jans.inbound.oidc_code.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.oidc_code.json b/code/io.jans.inbound.oidc_code.json new file mode 100644 index 0000000..9e9d156 --- /dev/null +++ b/code/io.jans.inbound.oidc_code.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/lib/README.md b/lib/README.md new file mode 100644 index 0000000..13f6385 --- /dev/null +++ b/lib/README.md @@ -0,0 +1 @@ +### Library folder \ No newline at end of file diff --git a/lib/io/README.md b/lib/io/README.md new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/lib/io/README.md @@ -0,0 +1 @@ +{} diff --git a/lib/io/jans/README.md b/lib/io/jans/README.md new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/lib/io/jans/README.md @@ -0,0 +1 @@ +{} diff --git a/lib/io/jans/inbound/README.md b/lib/io/jans/inbound/README.md new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/lib/io/jans/inbound/README.md @@ -0,0 +1 @@ +{} diff --git a/lib/io/jans/inbound/UserOnboardHelper.java b/lib/io/jans/inbound/UserOnboardHelper.java new file mode 100644 index 0000000..574dad3 --- /dev/null +++ b/lib/io/jans/inbound/UserOnboardHelper.java @@ -0,0 +1,37 @@ +package io.jans.inbound; + +import io.jans.as.common.model.common.User; +import io.jans.as.common.service.common.UserService; +import io.jans.service.cdi.util.CdiUtil; + +import java.util.*; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class UserOnboardHelper { + + private static Logger logger = LoggerFactory.getLogger(UserOnboardHelper.class); + + public static String exec(String prefix, Map profile) { + + String uid = prefix + profile.get("sub").toString(); + + //if not existing, insert user with the uid just built + UserService userService = CdiUtil.bean(UserService.class); + logger.debug("Retrieving user identified by {}", uid); + User user = userService.getUser(uid); + + if (user != null) { + logger.debug("Found!"); + } else { + logger.debug("Not found. Inserting entry"); + user = new User(); + user.setUserId(uid); + userService.addUser(user, true); + } + return uid; + + } + +} diff --git a/project.json b/project.json new file mode 100644 index 0000000..7aaf703 --- /dev/null +++ b/project.json @@ -0,0 +1,16 @@ +{ + "projectName": "agama-openid", + "description": "Authentication using an external OpenID Connect provider with the 'code' flow", + "type": "community", + "author": "jgomer2001", + "version": "0.0.1", + "authorWebsite": "https://github.com/GluuFederation/agama-openid", + "githubUri": "https://github.com/GluuFederation/agama-openid", + "license": "apache-2.0", + "lastUpdated": "1699278900783", + "tags": [ + "openid-connect" + ], + "noDirectLaunch": [], + "configs": {} +} \ No newline at end of file diff --git a/web/README.md b/web/README.md new file mode 100644 index 0000000..dd58691 --- /dev/null +++ b/web/README.md @@ -0,0 +1 @@ +### Web folder \ No newline at end of file