Skip to content

Commit ebfebb9

Browse files
Merge branch 'master' into dev/NPA-4517-post-headers
2 parents 2eb33f6 + f1cae5f commit ebfebb9

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
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

proxies/live/apiproxy/policies/OAuthV2.VerifyAccessTokenUserNhsLoginP9.xml renamed to proxies/live/apiproxy/policies/OAuthV2.VerifyAccessTokenUser.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<OAuthV2 async="false" continueOnError="false" enabled="true" name="VerifyAccessTokenUserNhsLoginP9">
1+
<!--Step 2: Adding VerifyAccessToken policy to your proxy-->
2+
<OAuthV2 async="false" continueOnError="false" enabled="true" name="VerifyAccessTokenUser">
23
<Operation>VerifyAccessToken</Operation>
3-
<Scopes>urn:nhsd:apim:user-nhs-login:P9:validated-relationships-service-api</Scopes>
4+
<Scopes>urn:nhsd:apim:user-nhs-login:P9:validated-relationships-service-api urn:nhsd:apim:user-nhs-id:aal3:validated-relationships-service-api</Scopes>
45
</OAuthV2>

proxies/live/apiproxy/targets/target.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PreFlow>
44
<Request>
55
<Step>
6-
<Name>VerifyAccessTokenUserNhsLoginP9</Name>
6+
<Name>VerifyAccessTokenUser</Name>
77
</Step>
88
<Step>
99
<Name>FlowCallout.ApplyRateLimiting</Name>
@@ -20,6 +20,14 @@
2020
<Step>
2121
<Name>AddUserAuthHeaders</Name>
2222
</Step>
23+
<Step>
24+
<Name>RaiseFault.401Unauthorized</Name>
25+
<Condition>accesstoken.auth_level != "aal3" and proxy.pathsuffix = "/FHIR/R4/Consent" and request.verb = "POST"</Condition>
26+
</Step>
27+
<Step>
28+
<Name>RaiseFault.401Unauthorized</Name>
29+
<Condition>accesstoken.auth_level != "p9" and (proxy.pathsuffix != "/FHIR/R4/Consent" or request.verb != "POST")</Condition>
30+
</Step>
2331
<Step>
2432
<Name>RaiseFault.415UnsupportedMediaType</Name>
2533
<Condition>request.verb = "POST" and request.header.Content-Type != "application/fhir+json" and request.header.Content-Type != "application/fhir+json; charset=utf-8"</Condition>

0 commit comments

Comments
 (0)