Skip to content

Commit

Permalink
Merge pull request #128 from Mahesh-Binayak/MOSIP-35987
Browse files Browse the repository at this point in the history
[MOSIP-35987]added new request and fixed some older issues.
  • Loading branch information
Mahesh-Binayak authored Nov 18, 2024
2 parents a7eac8d + 32fd7a2 commit 722497b
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 13 deletions.
5 changes: 4 additions & 1 deletion default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ onboard_mock_relying_party_with_mock_rp_oidc_client(){
--env-var ca-certificate="$root_ca_cert" \
--env-var leaf-certificate="$partner_cert" \
--env-var oidc-client-name="$OIDC_CLIENT_NAME" \
--env-var oidc-clientid="$OIDC_CLIENTID" \
--folder 'create_keycloak_user' \
--folder 'create/publish_policy_group_and_policy' \
--folder partner-self-registration \
Expand All @@ -307,6 +308,7 @@ onboard_mock_relying_party_with_mock_rp_oidc_client(){
--folder approve-partner-mapping-to-policy \
--folder get-jwks \
--folder create-oidc-client \
--folder create-oidc-client-through-esignet \
--folder delete-user \
$ADD_SSL_NEWMAN \
--export-environment ./config-secrets.json -d ./default-mock-rp-oidc-policy.json -r cli,htmlextra --reporter-htmlextra-export "$reports_dir/mock-rp-oidc.html" --reporter-htmlextra-showEnvironmentData
Expand Down Expand Up @@ -517,7 +519,7 @@ onboard_esignet_signup_oidc_partner(){
--env-var oidc-clientid="$OIDC_CLIENTID" \
--folder 'create_keycloak_user' \
--folder authenticate-to-upload-certs \
--folder create-oidc-client-through-esignet \
--folder create-oidc-client-through-esignet-signup \
--folder delete-user \
$ADD_SSL_NEWMAN \
--export-environment ./config-secrets.json -r cli,htmlextra --reporter-htmlextra-export "$reports_dir/signup-oidc.html" --reporter-htmlextra-showEnvironmentData
Expand Down Expand Up @@ -635,6 +637,7 @@ elif [ "$MODULE" = "mock-rp-oidc" ]; then
PARTNER_ORGANIZATION_NAME=IITB
PARTNER_TYPE=Auth_Partner
OIDC_CLIENT_NAME='Health service OIDC Client'
OIDC_CLIENTID='default-non-mosipid-oidc-client'
LOGO_URI=https://healthservices.$( printenv installation-domain)/logo.png
REDIRECT_URIS=https://healthservices.$( printenv installation-domain)/userprofile
root_cert_path="$MYDIR/certs/$PARTNER_KC_USERNAME/RootCA.pem"
Expand Down
113 changes: 101 additions & 12 deletions onboarding.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "2ea11a70-816b-4631-8929-6ec2d4b5fdb0",
"_postman_id": "34cbd0af-238b-49a8-b10f-dcfd373b5042",
"name": "onboarding Copy",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "12620596"
Expand Down Expand Up @@ -319,9 +319,12 @@
"listen": "prerequest",
"script": {
"exec": [
""
"if (pm.environment.get(\"mosip-id\") == 'false' ){\r",
" pm.execution.skipRequest()\r",
"}"
],
"type": "text/javascript"
"type": "text/javascript",
"packages": {}
}
},
{
Expand All @@ -333,7 +336,8 @@
"//console.log(data);\r",
"pm.environment.set(\"authtoken\",data);"
],
"type": "text/javascript"
"type": "text/javascript",
"packages": {}
}
}
],
Expand Down Expand Up @@ -596,9 +600,12 @@
"listen": "prerequest",
"script": {
"exec": [
""
"if (pm.environment.get(\"mosip-id\") == 'false' ){\r",
" pm.execution.skipRequest()\r",
"}"
],
"type": "text/javascript"
"type": "text/javascript",
"packages": {}
}
},
{
Expand All @@ -610,7 +617,8 @@
"//console.log(data);\r",
"pm.environment.set(\"authtoken\",data);"
],
"type": "text/javascript"
"type": "text/javascript",
"packages": {}
}
}
],
Expand Down Expand Up @@ -1321,16 +1329,18 @@
"//console.log(data);\r",
"pm.environment.set(\"authtoken\",data);"
],
"type": "text/javascript"
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"pm.environment.set('request-time', (new Date()).toISOString())"
""
],
"type": "text/javascript"
"type": "text/javascript",
"packages": {}
}
}
],
Expand Down Expand Up @@ -2591,6 +2601,9 @@
" console.error(\"Environment variable 'redirect-uris' is not defined.\");\r",
" pm.environment.set(\"redirect_uris_array\", \"[]\");\r",
"}\r",
"if (pm.environment.get(\"mosip-id\") == 'false' ){\r",
" pm.execution.skipRequest()\r",
"}\r",
""
],
"type": "text/javascript",
Expand Down Expand Up @@ -2676,7 +2689,7 @@
"response": []
},
{
"name": "create-oidc-client-through-esignet",
"name": "create-oidc-client-through-esignet-signup",
"event": [
{
"listen": "prerequest",
Expand Down Expand Up @@ -2751,6 +2764,82 @@
},
"response": []
},
{
"name": "create-oidc-client-through-esignet",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"// Pre-request script in Postman\r",
"let redirectUris = pm.environment.get(\"redirect-uris\");\r",
"\r",
"if (redirectUris) {\r",
" redirectUris = redirectUris.split(',').map(uri => uri.trim());\r",
" pm.environment.set(\"redirect_uris_array\", JSON.stringify(redirectUris));\r",
"} else {\r",
" console.error(\"Environment variable 'redirect-uris' is not defined.\");\r",
" pm.environment.set(\"redirect_uris_array\", \"[]\");\r",
"}\r",
""
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"validating clientid\", function () {\r",
" pm.expect(pm.response.text()).to.include(\"clientId\");\r",
"});\r",
"pm.test(\"validating clientid status\", function () {\r",
" pm.expect(pm.response.text()).to.include(\"ACTIVE\");\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{authtoken}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"requestTime\": \"{{$isoTimestamp}}\",\r\n \"request\": {\r\n \"clientId\": \"{{oidc-clientid}}\",\r\n \"clientName\": \"{{oidc-client-name}}\",\r\n \"publicKey\":\r\n {\r\n \"kty\": \"RSA\",\r\n \"e\": \"AQAB\",\r\n \"use\": \"sig\",\r\n \"kid\": \"{{keyid}}\",\r\n \"alg\": \"RS256\",\r\n \"n\": \"{{key}}\"\r\n},\r\n \"relyingPartyId\": \"{{oidc-client-name}}\",\r\n \"userClaims\": [\r\n \"birthdate\",\r\n \"address\",\r\n \"gender\",\r\n \"name\",\r\n \"phone_number\",\r\n \"picture\",\r\n \"email\",\r\n \"individual_id\"\r\n ],\r\n \"authContextRefs\": [\r\n \"mosip:idp:acr:linked-wallet\",\r\n \"mosip:idp:acr:biometrics\",\r\n \"mosip:idp:acr:generated-code\"\r\n ],\r\n \"logoUri\": \"{{logo-uri}}\",\r\n \"redirectUris\":{{redirect_uris_array}},\r\n \"grantTypes\": [\r\n \"authorization_code\"\r\n ],\r\n \"clientAuthMethods\": [\r\n \"private_key_jwt\"\r\n ]\r\n }\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{external-url}}/v1/esignet/client-mgmt/oidc-client",
"host": [
"{{external-url}}"
],
"path": [
"v1",
"esignet",
"client-mgmt",
"oidc-client"
]
}
},
"response": []
},
{
"name": "create-oidc-client-through-esignet-sunbird",
"event": [
Expand Down Expand Up @@ -3092,4 +3181,4 @@
}
}
]
}
}

0 comments on commit 722497b

Please sign in to comment.