question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OIDC client needs extra flexibility

See original GitHub issue

Description

I am attempting to authenticate with an NHS service that uses an idiosyncratic Microsoft OAuth implementation and I have hit an edge case that suggests some extra flexibility may be needed. Their service only has one endpoint which is the token endpoint. There is no auto-discovery. Due to this lack of auto-discovery, I have to set the token-path so I took the last part of the server URL and added that to token-path. However, the service insists that the JWT audience is the entire path to the token endpoint. When the JWT is signed however only the auth server URL is used for the audience. My configuration is

quarkus.oidc-client.client-enabled=true
quarkus.oidc-client.grant.type=client
quarkus.oidc-client.auth-server-url=https://dev.api.service.nhs.uk/oauth2
quarkus.oidc-client.client-id=<my_cid>
quarkus.oidc-client.discovery-enabled=false # token path MUST be set
quarkus.oidc-client.token-path=/token
quarkus.oidc-client.credentials.jwt.key-file=pk.pem
quarkus.oidc-client.credentials.jwt.token-key-id=<my-kid>
quarkus.oidc-client.credentials.jwt.signature-algorithm=RS512 # works as I am using the snapshot build

This means that in the OidcCommonUtils class in the signJwtWithKey method the JWT audience is set to https://dev.api.service.nhs.uk/oauth2 where the service insists on https://dev.api.service.nhs.uk/oauth2/token.

Implementation ideas

Maybe some configuration options could be added to override the default JWT values for these restricted OIDC implementations.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
liamorcommented, Nov 9, 2021

Sorry, I just re-checked and I didn’t need to set the issuer. I must have got something wrong previously.

1reaction
sberyozkincommented, Nov 9, 2021

@liamor My fault, forgot it has to be accompanied with override-matching-claims, see https://quarkus.io/guides/security-jwt-build#smallrye-jwt-builder-configuration

Read more comments on GitHub >

github_iconTop Results From Across the Web

allow option to disable nonce parameter and check ... - GitHub
And as a client it is not required to send one. This flexibility allows angular-auth-oidc-client to be applicable in more different ...
Read more >
Why you probably don't need OAuth2 / OpenID Connect! - Ory
Learn when you really need to integrate OAuth2 and OpenID Connect!
Read more >
OpenID Connect | Authentication - Google Developers
This document describes how to perform the server flow for authenticating the user. The implicit flow is significantly more complicated because ...
Read more >
OpenID Connect FAQ and Q&As
How does OpenID Connect enable creating an Internet identity ecosystem? · Interoperability · Security · Ease of deployment · Flexibility · Wide support...
Read more >
How OpenID Connect (OIDC) Works [TUTORIAL] | Ping Identity
Additional differences include: SAML is known for its flexibility, but most developers find OIDC easier to use because it is less complex. SAML...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found