Azure AD B2C won't resolve config in C# .net project after k8s upgrade
Joe White
0
Reputation points
In a local development environment we upgraded the version of k8s that we are using to 1.28.2. After the upgrade, with no code changes, our service that manages auth is throwing the exception below. This is occurring in multiple dev environments and the code functions as expected on the prior version.
What would cause the service to not be able to resolve that configuration? If I paste the URL into a browser it works as expected and shows the openid configuration.
The configuration for AD is unchanged:
"AzureAdB2C": {
"Instance": "https://mydirectory.b2clogin.com",
"ClientId": "XXXXXXXXX",
"Domain": "mydomain.onmicrosoft.com",
"TenantId": "XXXXXXX"
},
Exception caught in global error handler, exception message: IDX20803: Unable to obtain configuration from: 'https://mydirectory.b2clogin.com/mydirectory.onmicrosoft.com/B2C_1A_MYPOLICY/v2.0/.well-known/openid-configuration'., exception stack: at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
....
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'https://mydirectory.b2clogin.com/mydirectory.onmicrosoft.com/B2C_1A_MYPOLICY/v2.0/.well-known/openid-configuration'.
---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'https://mydirectory.b2clogin.com/mydirectory.onmicrosoft.com/B2C_1A_MYPOLICY/v2.0/.well-known/openid-configuration'.
---> System.Net.Http.HttpRequestException: Resource temporarily unavailable
---> System.Net.Sockets.SocketException (11): Resource temporarily unavailable
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
Sign in to answer