# PDS - Patient Access - Additional Scopes result in errors

**URL:** <https://developer.community.nhs.uk/t/pds-patient-access-additional-scopes-result-in-errors/731>\
**Category:** Personal Demographics Service (PDS)\
**Tags:** integration, pds, fhir, spine, testing, pds-fhir-api\
**Created:** [13 February 2024 22:57 UTC](https://developer.community.nhs.uk/t/pds-patient-access-additional-scopes-result-in-errors/731 "2024-02-13T22:57:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fastenhealth](https://avatars.discourse-cdn.com/v4/letter/f/a698b9/32.png) [@fastenhealth](https://developer.community.nhs.uk/u/fastenhealth)\
**Post date:** [13 February 2024 22:57 UTC](https://developer.community.nhs.uk/t/pds-patient-access-additional-scopes-result-in-errors/731/1 "2024-02-13T22:57:31Z")

</div>

Hi,

I’m attempting to integrate our patient-access consumer app with the PDS api’s and I’ve fun into a problem with the oauth2-mock service in the Integration Test environment.

We’re able to successfully authenticate as a fake patient ([9912003071](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/testing-apis-with-our-mock-authorisation-service#test-users-for-nhs-login)) with the Second-generation Mocked API service - [int.api.service.nhs.uk/oauth2-mock/authorize](http://int.api.service.nhs.uk/oauth2-mock/authorize)

However, this only works when using the “nhs-login” scope – which doesnt provide any information about the currently authenticated Patient, and we don’t have enough information to call the FHIR/R4/Patient/:id endpoint successfully.

When we add additional scopes, like “profile”, “openid” or “fhirUser”  
authorize url redirects to CIS MOCK INT instead of NHS LOGIN MOCK INT, and using the test user results in an “Invalid username” error.

 ![Screen Shot 2024-02-13 at 2.50.24 PM](https://europe1.discourse-cdn.com/nhsdigitaldeveloper/original/1X/564e8975f73a1b8284bd53d5173c2bb0b0f660a9.jpeg)

What is the correct way to retrieve the current user’s patient identifier and call the FHIR api?

---

<div class="post-metadata">

**Author:** ![alex.carrie](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@alex.carrie](https://developer.community.nhs.uk/u/alex.carrie)\
**Post date:** [15 February 2024 10:31 UTC](https://developer.community.nhs.uk/t/pds-patient-access-additional-scopes-result-in-errors/731/2 "2024-02-15T10:31:49Z")

</div>

Hello. For the mock auth the additional scopes are not supported. For the mocks I believe you need a valid user and then all the information should be in the test data packs for testing. [PDS FHIR API test data - NHS Digital](https://digital.nhs.uk/developer/api-catalogue/personal-demographics-service-fhir/pds-fhir-api-test-data)
