From b84424d0e690dc87dd8616152da81515e70ebc8a Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Wed, 4 Oct 2023 20:26:13 +0530 Subject: [PATCH 1/3] MOSIP-29513 --- .../OAuthDetailsRequestVCI.hbs | 17 + .../OAuthDetailsRequestVCI.yml | 500 ++++++++++++++++++ .../OAuthDetailsRequestVCIResult.hbs | 1 + .../testNgXmlFiles/esignetSuite.xml | 8 + 4 files changed, 526 insertions(+) create mode 100644 automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.hbs create mode 100644 automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml create mode 100644 automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult.hbs diff --git a/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.hbs b/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.hbs new file mode 100644 index 00000000000..6dec068b531 --- /dev/null +++ b/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.hbs @@ -0,0 +1,17 @@ +{ + "requestTime": "{{requestTime}}", + "request": { + "clientId": "{{clientId}}", + "scope": "{{scope}}", + "responseType": "{{responseType}}", + "redirectUri": "{{redirectUri}}", + "display": "{{display}}", + "prompt": "{{prompt}}", + "acrValues": "{{acrValues}}", + "nonce" : "{{nonce}}", + "state" : "{{state}}", + "claimsLocales" : "{{claimsLocales}}", + "codeChallenge" : "{{codeChallenge}}", + "codeChallengeMethod" : "{{codeChallengeMethod}}" + } +} \ No newline at end of file diff --git a/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml b/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml new file mode 100644 index 00000000000..d1a6b369d77 --- /dev/null +++ b/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml @@ -0,0 +1,500 @@ +OAuthDetailsRequestVCIVidNegTC: + ESignet_OAuthDetailsRequest_VCI_Vid_Empty_Scope_Neg: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_scope" + } + ] +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_SpaceVal_Scope_Neg: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": " ", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_scope" + } + ] +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_Diff_Scope_sid: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_Invalid_Scope_Neg: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "openid profile, mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_scope" + } + ] +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_Invalid_Code_Challenge_Method_Neg: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "sdgfdg" +}' + output: '{ + "errors": [ + { + "errorCode": "unsupported_pkce_challenge_method" + } + ] +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_Empty_Code_Challenge_Neg: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "", + "codeChallengeMethod": "S256" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_pkce_challenge" + } + ] +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_SpaceVal_Code_Challenge_Neg: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": " ", + "codeChallengeMethod": "S256" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_pkce_challenge" + } + ] +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_Empty_Code_Challenge_Method_Neg: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "" +}' + output: '{ + "errors": [ + { + "errorCode": "unsupported_pkce_challenge_method" + } + ] +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_SpaceVal_Code_Challenge_Method_Neg: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": " " +}' + output: '{ + "errors": [ + { + "errorCode": "unsupported_pkce_challenge_method" + } + ] +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_Long_Code_Challenge_Pos: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "2Krathy2lc9BgD5k1uZk0PKXeGuaKboSrJfdzKZoQhmMKA9Blx7YfkCaHahoNIOggCU3iGhHg6TxJn1cUztkt6G8HlkOjiMFfknDlKob4ZJR290EOraRCmqdonPtZkG2xOqqx0tqHBxZ6gXlIYJwpDQ8rzr1SsYe2Krathy2lc9BgD5k1uZk0PKXeGuaKboSrJfdzKZoQhmMKA9Blx7YfkCaHahoNIOggCU3iGhHg6TxJn1cUztkt6G8HlkOjiMFfknDlKob4ZJR290EOraRCmqdonPtZkG2xOqqx0tqHBxZ6gXlIYJwpDQ8rzr1SsYe2Krathy2lc9BgD5k1uZk0PKXeGuaKboSrJfdzKZoQhmMKA9Blx7YfkCaHahoNIOggCU3iGhHg6TxJn1cUztkt6G8HlkOjiMFfknDlKob4ZJR290EOraRCmqdonPtZkG2xOqqx0tqHBxZ6gXlIYJwpDQ8rzr1SsYe2Krathy2lc9BgD5k1uZk0PKXeGuaKboSrJfdzKZoQhmMKA9Blx7YfkCaHahoNIOggCU3iGhHg6TxJn1cUztkt6G8HlkOjiMFfknDlKob4ZJR290EOraRCmqdonPtZkG2xOqqx0tqHBxZ6gXlIYJwpDQ8rzr1SsYe2Krathy2lc9BgD5k1uZk0PKXeGuaKboSrJfdzKZoQhmMKA9Blx7YfkCaHahoNIOggCU3iGhHg6TxJn1cUztkt6G8HlkOjiMFfknDlKob4ZJR290EOraRCmqdonPtZkG2xOqqx0tqHBxZ6gXlIYJwpDQ8rzr1SsYe", + "codeChallengeMethod": "S256" +}' + output: '{ + +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_Missing_Code_Challenge_Pos: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$REMOVE$", + "codeChallengeMethod": "S256" +}' + output: '{ + +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_Missing_Code_Challenge_Method_Pos: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "$REMOVE$" +}' + output: '{ + +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_Missing_Code_Challenge_And_Method_Pos: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$REMOVE$", + "codeChallengeMethod": "$REMOVE$" +}' + output: '{ + +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen1_Valid_Smoke_sid: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen2_Valid_Smoke_sid: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen3_Valid_Smoke_sid: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen4_Valid_Smoke_sid: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen5_Valid_Smoke_sid: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + +}' \ No newline at end of file diff --git a/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult.hbs b/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult.hbs new file mode 100644 index 00000000000..9e26dfeeb6e --- /dev/null +++ b/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult.hbs @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/automationtests/testNgXmlFiles/esignetSuite.xml b/automationtests/testNgXmlFiles/esignetSuite.xml index 339d64682bf..9760ccc1b46 100644 --- a/automationtests/testNgXmlFiles/esignetSuite.xml +++ b/automationtests/testNgXmlFiles/esignetSuite.xml @@ -554,6 +554,14 @@ + + + + + + + From 2d4c921f1f61abf9fdc28f6f9b842856474216e9 Mon Sep 17 00:00:00 2001 From: kaifk468 <74772315+kaifk468@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:06:34 +0530 Subject: [PATCH 2/3] added create-vci-exchange api (#1100) --- .../controller/AuthRequestController.java | 75 ++++++++++++++++--- .../src/main/resources/application.properties | 3 +- 2 files changed, 68 insertions(+), 10 deletions(-) diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/AuthRequestController.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/AuthRequestController.java index c5c37461221..a45c3a29f27 100644 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/AuthRequestController.java +++ b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/AuthRequestController.java @@ -47,6 +47,7 @@ import javax.crypto.NoSuchPaddingException; import javax.xml.bind.DatatypeConverter; +import io.mosip.testrig.authentication.demo.service.dto.*; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.IOUtils; import org.bouncycastle.operator.OperatorCreationException; @@ -62,12 +63,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.lang.NonNull; import org.springframework.lang.Nullable; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.client.HttpServerErrorException; import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; @@ -90,9 +86,6 @@ import io.mosip.kernel.core.util.DateUtils; import io.mosip.kernel.core.util.HMACUtils2; import io.mosip.testrig.authentication.demo.service.controller.Encrypt.SplittedEncryptedData; -import io.mosip.testrig.authentication.demo.service.dto.CertificateChainResponseDto; -import io.mosip.testrig.authentication.demo.service.dto.EncryptionRequestDto; -import io.mosip.testrig.authentication.demo.service.dto.EncryptionResponseDto; import io.mosip.testrig.authentication.demo.service.helper.CertificateTypes; import io.mosip.testrig.authentication.demo.service.helper.KeyMgrUtil; import io.mosip.testrig.authentication.demo.service.helper.PartnerTypes; @@ -177,6 +170,8 @@ public class AuthRequestController { private static final String IDA_KYC_EXCHANGE_REQUEST_TEMPLATE = "ida.kycExchangeRequest.template"; + private static final String IDA_VCI_EXCHANGE_REQUEST_TEMPLATE = "ida.vciExchangeRequest.template"; + private static final String ID = "id"; private static final String CLASSPATH = "classpath"; @@ -574,6 +569,68 @@ public ResponseEntity createKycExchangeRequest(@RequestParam(name = ID, String.format(IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorMessage(), IDENTITY)); } } + + @PostMapping(path = "/create-vci-exchange-request", consumes = MediaType.APPLICATION_JSON_VALUE, produces = { + MediaType.APPLICATION_JSON_VALUE }) + public ResponseEntity createVciExchangeRequest(@RequestParam(name = ID, required = true) @Nullable String id, + @RequestParam(name = ID_TYPE, required = false) @Nullable String idType, + @RequestParam(name = "Authtype", required = false) @Nullable String reqAuth, + @RequestParam(name = TRANSACTION_ID, required = false) @Nullable String transactionId, + @RequestParam(name = "requestTime", required = false) @Nullable String requestTime, + @RequestParam(name = "vcFormat", required = false) @Nullable String vcFormat, + @RequestParam(name = "credSubjectId", required = false)@Nullable String credSubjectId, + @RequestParam(name = "vcAuthToken", required = false)@Nullable String vcAuthToken, + @RequestParam(name = "keyFileNameByPartnerName", required = false)boolean keyFileNameByPartnerName, + @RequestParam(name = "partnerName", required = false)@Nullable String partnerName, + @RequestBody Map request, + @RequestParam(name = "certsDir", required = false) String certsDir, + @RequestParam(name = "moduleName", required = false) String moduleName) throws Exception { + String authRequestTemplate = environment.getProperty(IDA_VCI_EXCHANGE_REQUEST_TEMPLATE); + Map reqValues = new HashMap<>(); + + if (requestTime == null) { + requestTime = DateUtils.getUTCCurrentDateTimeString(environment.getProperty("datetime.pattern")); + } + + reqValues.put(ID, id); + reqValues.put("individualIdType", idType == null || idType.trim().length() == 0 ? IdType.UIN.toString() : idType); + reqValues.put(AUTH_TYPE, reqAuth); + reqValues.put(TIMESTAMP, requestTime); + reqValues.put(TXN, transactionId == null ? "1234567890" : transactionId); + reqValues.put(VER, environment.getProperty(IDA_API_VERSION)); + reqValues.put("vcFormat", vcFormat); + reqValues.put("credSubjectId", credSubjectId); + reqValues.put("vcAuthToken", vcAuthToken); + + StringWriter writer = new StringWriter(); + InputStream templateValue; + if (request != null && request.size() > 0) { + templateValue = templateManager + .merge(new ByteArrayInputStream(authRequestTemplate.getBytes(StandardCharsets.UTF_8)), reqValues); + + if (templateValue != null) { + IOUtils.copy(templateValue, writer, StandardCharsets.UTF_8); + String res = writer.toString(); + ObjectNode response = mapper.readValue(res.getBytes(), ObjectNode.class); + + HttpHeaders httpHeaders = new HttpHeaders(); + String responseStr = response.toString(); + + String rpSignature = signRequest(PartnerTypes.MISP, partnerName, keyFileNameByPartnerName, responseStr, certsDir, moduleName); + httpHeaders.add("signature", rpSignature); + return new ResponseEntity<>(responseStr, httpHeaders, HttpStatus.OK); + } else { + throw new IdAuthenticationBusinessException( + IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorCode(), String.format( + IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorMessage(), TEMPLATE)); + } + } else { + throw new IdAuthenticationBusinessException( + IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorCode(), + String.format(IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorMessage(), IDENTITY)); + } + } + /** * this method is used to create the auth request. diff --git a/authentication-demo-service/src/main/resources/application.properties b/authentication-demo-service/src/main/resources/application.properties index cf22ff0f99e..0ca94feea60 100644 --- a/authentication-demo-service/src/main/resources/application.properties +++ b/authentication-demo-service/src/main/resources/application.properties @@ -20,6 +20,7 @@ ida-demo.api.version=v1 server.port = 8082 ida.authRequest.template={"consentObtained":true,"id":"mosip.identity.$authType","individualId":"$id","keyIndex":"string","request":"$encRequest","requestHMAC":"$encHmac","requestSessionKey":"$encSessionKey","requestTime":"$timestamp","transactionID":"$txn","version":"$ver","domainUri":"$domainUri","env":"$env","specVersion":"1.0","thumbprint":"$thumbprint"} ida.kycExchangeRequest.template={"consentObtained":["true"],"locales":["eng"],"id":"mosip.identity.$authType","individualId":"$id","individualIdType":"$individualIdType","kycToken":"$kycToken","respType":"$respType","metadata":"$request","requestTime":"$timestamp","transactionID":"$txn","version":"$ver"} +ida.vciExchangeRequest.template={"consentObtained":["true"],"locales":["eng"],"id":"mosip.identity.$authType","individualId":"$id","individualIdType":"$individualIdType","kycToken":"$kycToken","respType":"$respType","metadata":"$request","requestTime":"$timestamp","transactionID":"$txn","version":"$ver","vcAuthToken":"$vcAuthToken","credSubjectId":"$credSubjectId","vcAuthToken":"$vcAuthToken","vcFormat":"$vcFormat"} otpRequestTemplate={\ "id": "$reqId",\ "individualId": "$id",\ @@ -64,7 +65,7 @@ ida.api.version=1.0 javax.persistence.jdbc.driver=org.postgresql.Driver javax.persistence.jdbc.url=jdbc:postgresql://localhost:5432/ida_db javax.persistence.jdbc.user=postgres -javax.persistence.jdbc.password=admin +javax.persistence.jdbc.password=postgres # ********* Hibernate Properties *********** From 87aea106370c2e0abaef73775ed3080cf5a3c07d Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Thu, 5 Oct 2023 19:44:06 +0530 Subject: [PATCH 3/3] MOSIP-29513 --- .../AuthenticateUserVCI.hbs | 15 ++ .../AuthenticateUserVCI.yml | 231 ++++++++++++++++++ .../AuthenticateUserVCIResult.hbs | 1 + .../AuthorizationCodeVCI.hbs | 19 ++ .../AuthorizationCodeVCI.yml | 176 +++++++++++++ .../AuthorizationCodeVCIResult.hbs | 1 + .../OAuthDetailsRequestVCI.yml | 52 ++++ .../testNgXmlFiles/esignetSuite.xml | 30 +++ 8 files changed, 525 insertions(+) create mode 100644 automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI.hbs create mode 100644 automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI.yml create mode 100644 automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResult.hbs create mode 100644 automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI.hbs create mode 100644 automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI.yml create mode 100644 automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCIResult.hbs diff --git a/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI.hbs b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI.hbs new file mode 100644 index 00000000000..887633e1120 --- /dev/null +++ b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI.hbs @@ -0,0 +1,15 @@ +{ + "encodedHash": "{{encodedHash}}", + "requestTime": "{{requestTime}}", + "request": { + "transactionId": "{{transactionId}}", + "individualId": "{{individualId}}", + "challengeList" : [ + { + "authFactorType" : "{{authFactorType}}", + "challenge" : "{{challenge}}", + "format": "alpha-numeric" + } + ] + } +} \ No newline at end of file diff --git a/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI.yml b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI.yml new file mode 100644 index 00000000000..6dbb5b8225e --- /dev/null +++ b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI.yml @@ -0,0 +1,231 @@ +AuthenticateUserVCIVidNegTC: + ESignet_AuthenticateUserVCI_Vid_Otp_NegAuthCodeScen1_Valid_Smoke: + endPoint: /v1/esignet/authorization/authenticate + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI + outputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResultResult + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen1_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen1_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "authFactorType" : "OTP", + "challenge" : "$ID:AddIdentity_Valid_Params_VCI_Vid_Inv_Scen_smoke_Pos_EMAIL$", + "sendOtp":{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen1_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen1_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "otpChannels": [{channel: "email"},{channel: "phone"}], + "sendOtpReqTemplate": "esignet/SendOtp/SendOtp", + "sendOtpEndPoint": "/v1/esignet/authorization/send-otp" + } + }' + output: '{ + "sendOtpResp":{ + "maskedMobile": "XXXXXX3210", + "sendOtpResTemplate":"esignet/SendOtp/SendOtpResult", + "maskedEmail": "$IGNORE$" + } +}' + + ESignet_AuthenticateUserVCI_Vid_Otp_NegAuthCodeScen2_Valid_Smoke: + endPoint: /v1/esignet/authorization/authenticate + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI + outputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResultResult + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen2_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen2_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "authFactorType" : "OTP", + "challenge" : "$ID:AddIdentity_Valid_Params_VCI_Vid_Inv_Scen_smoke_Pos_EMAIL$", + "sendOtp":{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen2_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen2_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "otpChannels": [{channel: "email"},{channel: "phone"}], + "sendOtpReqTemplate": "esignet/SendOtp/SendOtp", + "sendOtpEndPoint": "/v1/esignet/authorization/send-otp" + } + }' + output: '{ + "sendOtpResp":{ + "maskedMobile": "XXXXXX3210", + "sendOtpResTemplate":"esignet/SendOtp/SendOtpResult", + "maskedEmail": "$IGNORE$" + } +}' + + ESignet_AuthenticateUserVCI_Vid_Otp_NegAuthCodeScen3_Valid_Smoke: + endPoint: /v1/esignet/authorization/authenticate + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI + outputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResultResult + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen3_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen3_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "authFactorType" : "OTP", + "challenge" : "$ID:AddIdentity_Valid_Params_VCI_Vid_Inv_Scen_smoke_Pos_EMAIL$", + "sendOtp":{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen3_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen3_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "otpChannels": [{channel: "email"},{channel: "phone"}], + "sendOtpReqTemplate": "esignet/SendOtp/SendOtp", + "sendOtpEndPoint": "/v1/esignet/authorization/send-otp" + } + }' + output: '{ + "sendOtpResp":{ + "maskedMobile": "XXXXXX3210", + "sendOtpResTemplate":"esignet/SendOtp/SendOtpResult", + "maskedEmail": "$IGNORE$" + } +}' + + ESignet_AuthenticateUserVCI_Vid_Otp_NegAuthCodeScen4_Valid_Smoke: + endPoint: /v1/esignet/authorization/authenticate + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI + outputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResultResult + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen4_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen4_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "authFactorType" : "OTP", + "challenge" : "$ID:AddIdentity_Valid_Params_VCI_Vid_Inv_Scen_smoke_Pos_EMAIL$", + "sendOtp":{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen4_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen4_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "otpChannels": [{channel: "email"},{channel: "phone"}], + "sendOtpReqTemplate": "esignet/SendOtp/SendOtp", + "sendOtpEndPoint": "/v1/esignet/authorization/send-otp" + } + }' + output: '{ + "sendOtpResp":{ + "maskedMobile": "XXXXXX3210", + "sendOtpResTemplate":"esignet/SendOtp/SendOtpResult", + "maskedEmail": "$IGNORE$" + } +}' + + ESignet_AuthenticateUserVCI_Vid_Otp_NegAuthCodeScen5_Valid_Smoke: + endPoint: /v1/esignet/authorization/authenticate + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI + outputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResultResult + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen5_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen5_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "authFactorType" : "OTP", + "challenge" : "$ID:AddIdentity_Valid_Params_VCI_Vid_Inv_Scen_smoke_Pos_EMAIL$", + "sendOtp":{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen5_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen5_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "otpChannels": [{channel: "email"},{channel: "phone"}], + "sendOtpReqTemplate": "esignet/SendOtp/SendOtp", + "sendOtpEndPoint": "/v1/esignet/authorization/send-otp" + } + }' + output: '{ + "sendOtpResp":{ + "maskedMobile": "XXXXXX3210", + "sendOtpResTemplate":"esignet/SendOtp/SendOtpResult", + "maskedEmail": "$IGNORE$" + } +}' + + ESignet_AuthenticateUserVCI_Vid_Otp_NegAuthCodeScen6_Valid_Smoke: + endPoint: /v1/esignet/authorization/authenticate + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI + outputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResultResult + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen6_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen6_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "authFactorType" : "OTP", + "challenge" : "$ID:AddIdentity_Valid_Params_VCI_Vid_Inv_Scen_smoke_Pos_EMAIL$", + "sendOtp":{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen6_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen6_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "otpChannels": [{channel: "email"},{channel: "phone"}], + "sendOtpReqTemplate": "esignet/SendOtp/SendOtp", + "sendOtpEndPoint": "/v1/esignet/authorization/send-otp" + } + }' + output: '{ + "sendOtpResp":{ + "maskedMobile": "XXXXXX3210", + "sendOtpResTemplate":"esignet/SendOtp/SendOtpResult", + "maskedEmail": "$IGNORE$" + } +}' + + ESignet_AuthenticateUserVCI_Vid_Otp_NegAuthCodeScen7_Valid_Smoke: + endPoint: /v1/esignet/authorization/authenticate + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCI + outputTemplate: esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResultResult + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen7_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen7_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "authFactorType" : "OTP", + "challenge" : "$ID:AddIdentity_Valid_Params_VCI_Vid_Inv_Scen_smoke_Pos_EMAIL$", + "sendOtp":{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen7_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen7_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:Generate_Perpetual_VID_VCI_Invalid_Scen_Smoke_sid_vid$", + "otpChannels": [{channel: "email"},{channel: "phone"}], + "sendOtpReqTemplate": "esignet/SendOtp/SendOtp", + "sendOtpEndPoint": "/v1/esignet/authorization/send-otp" + } + }' + output: '{ + "sendOtpResp":{ + "maskedMobile": "XXXXXX3210", + "sendOtpResTemplate":"esignet/SendOtp/SendOtpResult", + "maskedEmail": "$IGNORE$" + } +}' \ No newline at end of file diff --git a/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResult.hbs b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResult.hbs new file mode 100644 index 00000000000..9e26dfeeb6e --- /dev/null +++ b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthenticateUserVCI/AuthenticateUserVCIResult.hbs @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI.hbs b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI.hbs new file mode 100644 index 00000000000..491dca1ba1f --- /dev/null +++ b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI.hbs @@ -0,0 +1,19 @@ +{ + "encodedHash": "{{encodedHash}}", + "requestTime": "{{requestTime}}", + "request": { + "transactionId": "{{transactionId}}", + "acceptedClaims": [ + {{#each acceptedClaims}} + "{{claim}}" + {{#unless @last}},{{/unless}} + {{/each}} + ], + "permittedAuthorizeScopes": [ + {{#each permittedAuthorizeScopes}} + "{{scope}}" + {{#unless @last}},{{/unless}} + {{/each}} + ] + } +} \ No newline at end of file diff --git a/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI.yml b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI.yml new file mode 100644 index 00000000000..dd9f17a3bca --- /dev/null +++ b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI.yml @@ -0,0 +1,176 @@ +AuthorizationCodeVCIVidNegTC: + ESignet_AuthorizationCode_VCI_Vid_Invalid_Scope: + endPoint: /v1/esignet/authorization/auth-code + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen1_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen1_Valid_Smoke_sid_transactionId$", + "permittedAuthorizeScopes": [{scope: "sdfsfd"}] +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_permitted_scope" + } + ] +}' + + ESignet_AuthorizationCode_VCI_Vid_Empty_Scope: + endPoint: /v1/esignet/authorization/auth-code + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen2_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen2_Valid_Smoke_sid_transactionId$", + "permittedAuthorizeScopes": [{scope: ""}] +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_permitted_scope" + } + ] +}' + + ESignet_AuthorizationCode_VCI_Vid_Invalid_Comma_Separated_Scope: + endPoint: /v1/esignet/authorization/auth-code + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen3_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen3_Valid_Smoke_sid_transactionId$", + "permittedAuthorizeScopes": [{scope: "sdfaf, asdf"}] +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_permitted_scope" + } + ] +}' + + ESignet_AuthorizationCode_VCI_Vid_Invalid_Diff_Scope: + endPoint: /v1/esignet/authorization/auth-code + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_Diff_Scope_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_Diff_Scope_sid_transactionId$", + "permittedAuthorizeScopes": [{scope: "mosip_identity_vc_ldp"}] +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_permitted_scope" + } + ] +}' + + ESignet_AuthorizationCode_VCI_Vid_Invalid_Claim_Neg: + endPoint: /v1/esignet/authorization/auth-code + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen4_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen4_Valid_Smoke_sid_transactionId$", + "acceptedClaims": [{claim: "name"}] +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_accepted_claim" + } + ] +}' + + ESignet_AuthorizationCode_VCI_Vid_SpaceVal_Scope: + endPoint: /v1/esignet/authorization/auth-code + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen5_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen5_Valid_Smoke_sid_transactionId$", + "permittedAuthorizeScopes": [{scope: " "}] +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_permitted_scope" + } + ] +}' + + ESignet_AuthorizationCode_VCI_Vid_Empty_Claim_Neg: + endPoint: /v1/esignet/authorization/auth-code + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen6_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen6_Valid_Smoke_sid_transactionId$", + "acceptedClaims": [{claim: ""}] +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_accepted_claim" + } + ] +}' + + ESignet_AuthorizationCode_VCI_Vid_spaceVal_Claim_Neg: + endPoint: /v1/esignet/authorization/auth-code + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen7_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen7_Valid_Smoke_sid_transactionId$", + "acceptedClaims": [{claim: " "}] +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_accepted_claim" + } + ] +}' \ No newline at end of file diff --git a/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCIResult.hbs b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCIResult.hbs new file mode 100644 index 00000000000..9e26dfeeb6e --- /dev/null +++ b/automationtests/src/main/resources/esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCIResult.hbs @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml b/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml index d1a6b369d77..be05d56276c 100644 --- a/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml +++ b/automationtests/src/main/resources/esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml @@ -497,4 +497,56 @@ OAuthDetailsRequestVCIVidNegTC: }' output: '{ +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen6_Valid_Smoke_sid: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + +}' + + ESignet_OAuthDetailsRequest_VCI_Vid_NegAuthCodeScen7_Valid_Smoke_sid: + endPoint: /v1/esignet/authorization/v2/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI + outputTemplate: esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCIResult + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", + "scope": "mosip_identity_vc_ldp", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code mosip:idp:acr:linked-wallet mosip:idp:acr:biometrics", + "nonce": "973eieljzng", + "state": "eree2311", + "claimsLocales": "en", + "codeChallenge": "$CODECHALLENGE$", + "codeChallengeMethod": "S256" +}' + output: '{ + }' \ No newline at end of file diff --git a/automationtests/testNgXmlFiles/esignetSuite.xml b/automationtests/testNgXmlFiles/esignetSuite.xml index 9760ccc1b46..58f71048b71 100644 --- a/automationtests/testNgXmlFiles/esignetSuite.xml +++ b/automationtests/testNgXmlFiles/esignetSuite.xml @@ -562,6 +562,21 @@ + + + + + + + + + + + + + @@ -588,6 +603,21 @@