Skip to content

PO-3956 Handle User Service token rejection during auth#2034

Draft
Elizabeth1420 wants to merge 2 commits into
masterfrom
PO-3956-Token-Expiry
Draft

PO-3956 Handle User Service token rejection during auth#2034
Elizabeth1420 wants to merge 2 commits into
masterfrom
PO-3956-Token-Expiry

Conversation

@Elizabeth1420

@Elizabeth1420 Elizabeth1420 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

https://tools.hmcts.net/jira/browse/PO-3956

User Service returns 401 during authentication

  • Handle User Service 401 responses during authentication as invalid bearer tokens
  • Add integration coverage for PO-3956 token-expiry race scenario ###

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

@Elizabeth1420
Elizabeth1420 force-pushed the PO-3956-Token-Expiry branch from 5b1cde5 to 345f41d Compare July 8, 2026 13:25

@Sean-Reed-CGI Sean-Reed-CGI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

StubMapping unauthorizedUserStateStub = stubFor(get("/opal/v2/users/0/state")
.withHeader("Authorization", equalTo("Bearer " + validToken))
.atPriority(1)
.willReturn(aResponse().withStatus(401)));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor, could use HttpStatus.UNAUTH'd here. I'll approve, up to you if you want to change it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've updated it now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants