[BUG] 'authority' should be in Uri format when running in Docker container
See original GitHub issueDescribe the bug
When running below snippet in 3.1 .net core SDK container:
creds = await ApplicationTokenProvider.LoginSilentAsync(_domain, _clientId, _clientSecret, adSettings);
When running on the host - no issues. Container has access to network with no limits.
Exception or Stack Trace “ClassName”: “System.ArgumentException”, “Message”: “‘authority’ should be in Uri format”, “Data”: null, “InnerException”: null, “HelpURL”: null, “StackTraceString”: " at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Instance.Authenticator.DetectAuthorityType(String authority)\n at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Instance.Authenticator.Init(String authority, Boolean validateAuthority)\n at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Instance.Authenticator…ctor(String authority, Boolean validateAuthority)\n at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext…ctor(IHttpManager httpManager, String authority, AuthorityValidationType validateAuthority, TokenCache tokenCache)\n at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext…ctor(String authority, Boolean validateAuthority, TokenCache tokenCache)\n at Microsoft.Rest.Azure.Authentication.ApplicationTokenProvider.GetAuthenticationContext(String domain, ActiveDirectoryServiceSettings serviceSettings, TokenCache cache)\n at Microsoft.Rest.Azure.Authentication.ApplicationTokenProvider.LoginSilentAsync(String domain, String clientId, IApplicationAuthenticationProvider authenticationProvider, ActiveDirectoryServiceSettings settings, TokenCache cache)\n at Microsoft.Rest.Azure.Authentication.ApplicationTokenProvider.LoginSilentAsync(String domain, ClientCredential credential, ActiveDirectoryServiceSettings settings, TokenCache cache)\n at Microsoft.Rest.Azure.Authentication.ApplicationTokenProvider.LoginSilentAsync(String domain, String clientId, String secret, ActiveDirectoryServiceSettings settings, TokenCache cache)\n at Microsoft.Rest.Azure.Authentication.ApplicationTokenProvider.LoginSilentAsync(String domain, String clientId, String secret, ActiveDirectoryServiceSettings settings)\n at AnalyticsReaderBase.HandleTimer(DateTime queryStartTime, Int32 retry, Guid requestId) in*AnalyticsReaderActorBase.cs:line 90", “RemoteStackTraceString”: null, “RemoteStackIndex”: 0, “ExceptionMethod”: null, “HResult”: -2147024809, “Source”: “Microsoft.IdentityModel.Clients.ActiveDirectory”, “WatsonBuckets”: null, “ParamName”: “authority”
To Reproduce Create a snippet that is creating creds Push code to container
Code Snippet
creds = await ApplicationTokenProvider.LoginSilentAsync(_domain, _clientId, _clientSecret, adSettings);
Expected behavior shall return creds handler
Screenshots
Setup (please complete the following information):
- OS: docker .net Core SDK 3.1 container
- IDE : n/a
- Version of the Library used “Microsoft.Rest.ClientRuntime.Azure.Authentication” Version=“2.4.0”
Additional context Add any other context about the problem here.
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [ x] Bug Description Added
- [ x] Repro Steps Added
- [ x] Setup information Added
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (8 by maintainers)
Top GitHub Comments
@yungezz not sure why I got pinged here, maybe because I contributed to the code? sorry I have no context other than being some rando from time to time contributing some code 👯♂️
Thank you @profesor79. Closing for now.