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.

Named oidc-client configuration from .env file is null

See original GitHub issue

Describe the bug

I’m creating an named oidc-client in my application and the configuration come from a .env file. When quakus starts the config properties are loaded correctly but the injected client is null, same when injecting OidcClients, there’s no client inside. The exact same configuration in application.properties file is working fine. If the client is not a named one, it seem’s to work, but the grant types are not defined, i didn’t dig more on it because that’s what I saw when creating the reproduction.

Expected behavior

The injected OidcClient from .env configurations is not null.

Actual behavior

The injected OidcClient from .env configurations is null.

How to Reproduce?

Steps to reproduce:

  1. Create a named oidc-client configuration in .env
  2. Inject the OidcClient

Reproducer: https://github.com/Sirz3chs/quarkus-oidc-client-env-issue

Output of uname -a or ver

Linux 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

OpenJDK Runtime Environment Temurin-17+35 (build 17+35)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.13.4.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)

Additional information

The issue is still reproductible in 2.14.0.Final. I’ve foud two closed issues that may be related #14480 #24078

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sberyozkincommented, Nov 23, 2022

Hi @radcortez Thanks for the advice, quarkus.oidc-client.env-client.auth-server-url=${QUARKUS_OIDC_CLIENT__ENV_CLIENT__AUTH_SERVER_URL}

Looks OK to me, and @Sirz3chs has confirmed it works. I can work on a doc PR adding a note to the config docs and to OIDC docs to clarify https://github.com/quarkusio/quarkus/issues/29325#issuecomment-1322078347

1reaction
radcortezcommented, Nov 21, 2022

Yes, most likely, this is related to the ENV rules: https://quarkus.io/guides/config-reference#environment-variables

Which links to: https://smallrye.io/smallrye-config/2.12.1/config/environment-variables/

The issue is that when you have an ENV var like QUARKUS_OIDC_CLIENT__ENV_CLIENT__CLIENT_ID, without anymore information and where ENV_CLIENT is a name (dynamically generated by the user), we don’t know if the _ should map to a . or a -. It could be:

  • quarkus.oidc.client.env.client.client.id
  • quarkus.oidc.client.env-client.client.id

To disambiguate the case, we require to place the expected property name quarkus.oidc.client.env-client.client.id in a lower ordinal source. It can be application.properties and it can be empty because the ENV var will override it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenID Connect Client and Token Propagation Quickstart
This quickstart demonstrates how to use OpenID Connect Client Reactive Filter to acquire and propagate access tokens as HTTP Authorization Bearer access ...
Read more >
TroubleShoot: OpenID Connect, WebSphere traditional - IBM
This document contains troubleshooting information for OpenID Connect (OIDC) Trust Association Interceptor (TAI) problems in the WebSphere® Application ...
Read more >
OpenIdConnectAuthenticationHa...
State is null or empty, when connecting to any OIDC Server;Tried ... void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.
Read more >
OpenID Connect Client (openidConnectClient) - Open Liberty
Name Type Default accessTokenCacheEnabled boolean true accessTokenCacheTimeout A period of time with millisecond precision 5m accessTokenInLtpaCookie boolean false
Read more >
Configuring an OpenID Connect identity provider
OpenShift Container Platform user names containing / , : , and % are not supported. ... generic <secret_name> --from-file=<path_to_file> -n openshift-config ...
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