# PDS FHIR API - Public Key Misconfigured

**URL:** <https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462>\
**Category:** Personal Demographics Service FHIR API\
**Tags:** fhir, spine\
**Created:** [4 September 2023 08:35 UTC](https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462 "2023-09-04T08:35:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![LRS](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/lrs/32/171_2.png) [@LRS](https://developer.community.nhs.uk/u/LRS)\
**Post date:** [4 September 2023 08:35 UTC](https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462/1 "2023-09-04T08:35:49Z")

</div>

Hi all,

We’re trying to integrate the PDS FHIR API into our application. It works great for the Integration test endpoint, but we’re having some difficulties when deploying to prod.

Specifically, we get the following:

```auto
  {
          "error": "public_key error",
          "error_description": "The JWKS endpoint, for your client_assertion can't be reached",
          "message_id": "rrt-4745027357182055535-b-geu2-20324-110203-1"
  }

```

According to the developer hub, our JWKS end-point (Self-hosted) is configured fine. It says “Your public key is valid”

However, the info here clearly states the error is related to a poorly configured public key.

 ![Key_Misconfigured](https://europe1.discourse-cdn.com/nhsdigitaldeveloper/original/1X/6b7563c6d22b45cece40843824dbad741e8d4629.png)

Can you offer suggestions on where to go from here?

I’ve checked [our JWKS end-point](https://jwks.earl.health) against the [JWK standard](https://datatracker.ietf.org/doc/html/rfc7517) and it looks fine.  
I’ve also checked it against our public/private keypair and it looks fine.

I would be very grateful for direction from here.

Thank you

\*\*Removed images, as new users can ony embed one image, apparently \*\*\*

---

<div class="post-metadata">

**Author:** ![LRS](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/lrs/32/171_2.png) [@LRS](https://developer.community.nhs.uk/u/LRS)\
**Post date:** [25 April 2024 20:16 UTC](https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462/2 "2024-04-25T20:16:14Z")

</div>

Just a nudge.  
Still haven’t overcome this, and hoped someone might be able to offer some direction.  
Thank you

---

<div class="post-metadata">

**Author:** ![richard.seacome1](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@richard.seacome1](https://developer.community.nhs.uk/u/richard.seacome1)\
**Post date:** [26 April 2024 14:27 UTC](https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462/3 "2024-04-26T14:27:12Z")

</div>

Hi Leigh,  
Sorry for the delay you’ve experienced.  
Please could you send me the follow information.

- Product Application Name
- Application ID
- Integration Test environment name  
I’ll pass this on and we’ll analyse our logs to see if we can help you further.

Many thanks for your patience,

Richard

---

<div class="post-metadata">

**Author:** ![LRS](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/lrs/32/171_2.png) [@LRS](https://developer.community.nhs.uk/u/LRS)\
**Post date:** [26 April 2024 15:24 UTC](https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462/4 "2024-04-26T15:24:59Z")

</div>

Hi Richard,  
Thank you, details as follows:

**Production Environment**  
Application name is EARL-production  
Application ID is e1017690-60b9-45f7-9cda-21ae12ce40e0

**Integration Test Environment**  
Application name EARL-integration-test

We’ve ran some searches a few minutes ago in the test (successfully) and prod (still get same errors), so there should be some things in the logs for you to review.

Thank you

---

<div class="post-metadata">

**Author:** ![richard.seacome1](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@richard.seacome1](https://developer.community.nhs.uk/u/richard.seacome1)\
**Post date:** [29 April 2024 07:03 UTC](https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462/5 "2024-04-29T07:03:43Z")

</div>

thanks for that Leigh, I’ll get this info passed on. Many thanks

---

<div class="post-metadata">

**Author:** ![richard.seacome1](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@richard.seacome1](https://developer.community.nhs.uk/u/richard.seacome1)\
**Post date:** [1 May 2024 15:47 UTC](https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462/6 "2024-05-01T15:47:37Z")

</div>

Hi Leigh, we’ve checked your app config. It looks lik there is no api and no jwks in the custom attributes. The team looking into this have suggested setting up a meeting to trace the issue. Please could you let me have an email address to send the meeting request to and some times that are convenient over the next week to set the session to? Many thanks

---

<div class="post-metadata">

**Author:** ![LRS](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/lrs/32/171_2.png) [@LRS](https://developer.community.nhs.uk/u/LRS)\
**Post date:** [1 May 2024 16:51 UTC](https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462/7 "2024-05-01T16:51:22Z")

</div>

Thanks Richard.  
I’ve DM’d you.  
😀

---

<div class="post-metadata">

**Author:** ![richard.seacome1](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@richard.seacome1](https://developer.community.nhs.uk/u/richard.seacome1)\
**Post date:** [2 May 2024 14:56 UTC](https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462/8 "2024-05-02T14:56:58Z")

</div>

> [@LRS](#):
>
> **Production Environment**  
> Application name is EARL-production  
> Application ID is e1017690-60b9-45f7-9cda-21ae12ce40e0
> 
> **Integration Test Environment**  
> Application name EARL-integration-test

Hi Leigh, have sent you an invite for Tuesday afternoon for a meeting for diagnosis/trace.

Many thanks  
Richard

---

<div class="post-metadata">

**Author:** ![LRS](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/lrs/32/171_2.png) [@LRS](https://developer.community.nhs.uk/u/LRS)\
**Post date:** [10 May 2024 14:14 UTC](https://developer.community.nhs.uk/t/pds-fhir-api-public-key-misconfigured/462/9 "2024-05-10T14:14:10Z")

</div>

Thought it worth following up here, for anyone that subsequently finds their way to this post searching for the answer.

@richard.seacome1 facilitated a short meeting with a couple of helpful NHS developers, who were quickly able to identify that, although my JWKS endpoint was correctly configured in my NHS Developer portal, it had not propogated to a back end system correctly.

They updated the endpoint in their back end systems, and it worked immediately. Several months of troubleshooting… Still. All done now I guess!

Thank you @richard.seacome1 !
