-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment Specific AppSettings not honored. #656
Comments
Hi @rcollette, Thanks for reporting this. Our team will review it and prioritize it accordingly. Internal Ref: OKTA-637428 |
The root of this issue is that this library is not using the standard .NET configuration apis, and it's really creating a conundrum for me. https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration I should be able to do public void ConfigureServices(IServiceCollection services)
{
services
.AddSingleton<IConfiguration>(
_ => new ConfigurationBuilder()
.AddJsonFile("appsettings.json", true)
.AddEnvironmentVariables()
.Build())
.AddSingleton<IUserApi, UserApi>()
# My own class that uses IUserApi
.AddSingleton<IOktaUserClient, OktaUserClient>()
} and it should just work. |
@rcollette, we have received a PR to handle this issue. We would love to get your feedback on the proposed changes |
I have a posted a dirty workaround until that PR finally is merged: |
Describe the bug?
Environment specific configurations are not honored.
What is expected to happen?
Configuration that is present in appsetting.development.json (and others) should override the settings in appsettings.json
What is the actual behavior?
The SDK is only looking at configuration properties in appsettings.json
Reproduction Steps?
Create an SDK configuration in appsettings.json that has an invalid token
Create a valid configuration in appsettings.development.json
Use a launchSetttings.json file like:
Set the following environment variable
ASPNETCORE_ENVIRONMENT=Development
OKTA api calls will fail with this configuration, when running in local (development) mode.
Additional Information?
No response
.NET Version
7.0.306
SDK Version
6.0.11
OS version
Darwin MacBook-Pro-3.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered: