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.

[BUG] 'authority' should be in Uri format when running in Docker container

See original GitHub issue

Describe 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 image

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:closed
  • Created 3 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
danielmarbachcommented, Jun 9, 2020

@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 👯‍♂️

0reactions
AlexGhiondeacommented, Oct 10, 2021

Thank you @profesor79. Closing for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'authority' should be in Uri format Parameter name: authority
'authority' should be in Uri format Parameter name: authority Description: An unhandled exception occurred during the execution of the current ...
Read more >
Systemd fails to run in a docker container when using ...
I am trying to understand why this is happening, and figure out what should be done. My goal is to run systemd inside...
Read more >
How can I debug a docker container initialization?
First start docker events in the background to see whats going on. docker events&. Then run your failing docker run ... command. Then...
Read more >
Docker Engine 20.10 release notes
Docker Engine 20.10 release notes. This document describes the latest changes, additions, known issues, and fixes for Docker Engine version 20.10.
Read more >
Troubleshooting errors with Docker commands when using ...
In some cases, running a Docker command against Amazon ECR may result in an error message. Some common error messages and potential solutions...
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