Skip to content

Commit 86cc778

Browse files
NPA-4591: New OAuthV2 policy for CIS2 AAL3 scope conditionally applied in Target PreFlow
1 parent 62d8543 commit 86cc778

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

manifest_template.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ apigee:
9191
{% if ENV.has_mock_auth | default(false) %}
9292
- identity-service-mock-{{ ENV.name }}
9393
{% endif %}
94-
scopes:
94+
scopes: # Step 1: Configured product to include scopes
9595
- 'urn:nhsd:apim:user-nhs-login:P9:{{ SERVICE_NAME }}'
96+
- 'urn:nhsd:apim:user-nhs-id:aal3:{{ SERVICE_NAME }}'
9697
specs:
9798
- name: {{ NAME }}
9899
path: {{ SERVICE_NAME }}.json
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!--Step 2: Adding VerifyAccessToken policy to your proxy-->
2+
<OAuthV2 async="false" continueOnError="false" enabled="true" name="VerifyAccessTokenUserCIS2AAL3">
3+
<Operation>VerifyAccessToken</Operation>
4+
<Scopes>urn:nhsd:apim:user-nhs-id:aal3:validated-relationships-service-api</Scopes>
5+
</OAuthV2>

proxies/live/apiproxy/targets/target.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
<TargetEndpoint name="validated-relationships-service-api-target">
33
<PreFlow>
44
<Request>
5+
<!--Step 3: Configuring the VerifyAccessToken policy to restrict access-->
56
<Step>
7+
<Condition>(proxy.pathsuffix MatchesPath "/Consent") and (request.verb = "POST")</Condition>
8+
<Name>VerifyAccessTokenUserCIS2AAL3</Name>
9+
</Step>
10+
<Step>
11+
<Condition>(proxy.pathsuffix != "/Consent") or (request.verb != "POST")</Condition>
612
<Name>VerifyAccessTokenUserNhsLoginP9</Name>
713
</Step>
814
<Step>

0 commit comments

Comments
 (0)