Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Failed to find Identity Service for https://dev.azure.com via location service [401] #773

Closed
obivandamme opened this issue Oct 4, 2018 · 13 comments

Comments

@obivandamme
Copy link

Hey everyone,

I am using an azure devops repository and whenever I want to fetch, pull or push to it git asks for credentials. I activated the trace as you described in some of the other Issues and found the following lines

08:41:44.116052 ...\Common.cs:744 trace: [Main] git-credential-manager (v1.18.0) 'get'
08:41:44.168923 ...\Git\Where.cs:348 trace: [FindGitInstallations] found 1 Git installation(s).
08:41:44.172918 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 53 entries.
08:41:44.215783 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://dev.azure.com/'.
08:41:44.476245 ...uthentication.cs:229 trace: [DetectAuthority] detected 'https://dev.azure.com/tenant/' as Azure DevOps from GET response.
08:41:44.477198 ...uthentication.cs:297 trace: [DetectAuthority] tenant resource for 'https://dev.azure.com/{tenant}/' is {00000000000000000000000000000000}.
08:41:44.479192 ...uthentication.cs:362 trace: [GetAuthentication] MSA authority detected.
08:41:44.507117 ...\Common.cs:205 trace: [CreateAuthentication] authority for 'https://dev.azure.com/' is Microsoft Live.
08:41:44.507117 ...\Common.cs:765 trace: [QueryCredentials] querying 'MicrosoftAccount' for credentials.
08:41:56.525719 ...\Authority.cs:195 trace: [InteractiveAcquireToken] authority host URL = 'https://login.microsoftonline.com/live.com', token acquisition for tenant [somebase64] succeeded.
08:41:56.525719 ...Authentication.cs:84 trace: [InteractiveLogon] token 'https://dev.azure.com/' successfully acquired.
08:41:56.711925 ...\Authority.cs:375 trace: [GetIdentityServiceUri] failed to find Identity Service for 'https://dev.azure.com/' via location service [401].
08:41:56.714918 ...\Authority.cs:136 trace: [GeneratePersonalAccessToken] ! error: 'Failed to find Identity Service for https://dev.azure.com/.'.
08:41:56.714918 ...\Authority.cs:139 trace: [GeneratePersonalAccessToken] personal access token acquisition for 'https://dev.azure.com/' failed.
08:41:56.714918 ...\Common.cs:854 trace: [QueryCredentials] credentials for 'https://dev.azure.com/' not found.
08:41:56.716913 ...\Common.cs:709 trace: [LogEvent] Failed to retrieve Microsoft Live credentials for 'https://dev.azure.com/'.
08:41:56.721895 ...\Program.cs:414 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.

It seems like the authorization against the location service fails, even though the credentials for azure devops are ok. I tried wrong credentials and this failed in the browser windows with a "failed login" error. The log above was created with correct credentials.
I am using the latest versions of git for windows (2.19.0) and the credential manager (1.18.0) downloaded and installed today.

I hope you can help me get this fixed.

Best regards

Pascal

@obivandamme obivandamme changed the title Failed to find Identity Service for https://dev.azure.com via location sevrice [401] Failed to find Identity Service for https://dev.azure.com via location service [401] Oct 4, 2018
@jeschu1
Copy link
Member

jeschu1 commented Oct 8, 2018

@obivandamme please email me at jeschu@microsoft.com and we'll gather more information

@jeschu1 jeschu1 modified the milestone: v.18.1 Oct 9, 2018
@dafergu2
Copy link

I'm having the exact same issue.

Please note that I recently renamed my organization. I'm not sure if that caused the issue or not, but when setting up a new clone under the new url, this exact issue happened for me.

I also encountered a null reference exception and was forced to manually install 1.18.1 which fixed the NRE but not the authentication issue.

@jeschu1
Copy link
Member

jeschu1 commented Oct 12, 2018

@dafergu2, please email at jeschu@microsoft.com and we can dig more

@obivandamme 's issue was most likely user specific and he is following up with support. GCM appears to be doing the right thing however he is getting 401's back from the server. Others at his company can connect using the same GCM.

@obivandamme
Copy link
Author

After days of trial and error I finally found out what the Issue was. Maybe this works for you as well if you face the same Issue.

When I entered my E-Mail Address in the login prompt I was asked if I want to use my Company / School Account or my Personal Account. If I selected company account the login in the prompt worked, but the login in git failed, because the repository was linked to my personal account. Selecting that one solved the issue.

@hbsis-fernandomedeiros
Copy link

Same issue here, although GCM doesn't ask me if my account is Personal or Company/School.

Log:
14:16:43.994254 ...\Authority.cs:375 trace: [GetIdentityServiceUri] failed to find Identity Service for 'https://dev.azure.com/[team]/_apis/ServiceDefinitions/LocationService2/951917AC-A960-4999-8464-E3F0AA25B381?api-version=1.0' via location service [401].
14:16:43.995252 ...\Authority.cs:136 trace: [GeneratePersonalAccessToken] ! error: 'Failed to find Identity Service for https://dev.azure.com/.'.

@jeschu1
Copy link
Member

jeschu1 commented Oct 16, 2018

@hbsis-fernandomedeiros that's useful. GCM appears to be pinging the correct url there. Next steps would be verifying the account exists and you have access. I would followup with DevOps support.

@jeschu1
Copy link
Member

jeschu1 commented Oct 19, 2018

@obivandamme , we're using Adal's library for auth. Thats the picker you are seeing here.

If you've got thoughts on how it can be improved please do pass it on to them!

@jeschu1
Copy link
Member

jeschu1 commented Oct 22, 2018

Affected users have been updated via email or on the thread. If not the case feel free to reopen.

@jeschu1 jeschu1 closed this as completed Oct 22, 2018
@jcbeck37
Copy link

jcbeck37 commented Oct 24, 2018

Also having the same issue.

  • On DevOps, created alternate credentials.
  • Added these to Windows Credential Manager
  • When I issue git commands (i.e. fetch) from terminal, I get prompted for Active Directory credentials. I enter and check remember.
  • Each additional command triggers another prompt

I'm using the latest GIT and GCM. I cleared GCM's tenant.cache, which was necessary to at least get the Microsoft prompt to forward to my organization login. But I'm not able to persist my Microsoft credentials.

16:09:57.211084 ...\Authority.cs:136 trace: [GeneratePersonalAccessToken] ! error: 'Failed to find Identity Service for https://MyCompany.visualstudio.com/.'.
16:09:57.211084 ...\Authority.cs:139 trace: [GeneratePersonalAccessToken] personal access token acquisition for 'https://MyCompany.visualstudio.com/' failed.

@skowronek
Copy link

Same issue for me. I have a ticket with VS.com. What's the fix please?

https://developercommunity.visualstudio.com/content/problem/404040/unable-to-authenticate-against-vscom-git-repo.html

@obivandamme
Copy link
Author

obivandamme commented Dec 13, 2018

The Issue was that my office live account was registered with azure dev ops, but because of a previous login on my personal live account with the same username, the login prompt chose the private account automatically. this caused the authentication against microsoft live to work, but the user was rejected by dev ops. you need to perform a manual logout from Microsoft live so that the login prompt will ask you if you want to login with the private or company account. choose the right one and it works.

@skowronek
Copy link

The Issue was that my office live account was registered with azure dev ops, but because of a previous login on my personal live account with the same username, the login prompt chose the private account automatically. this caused the authentication against microsoft live to work, but the user was rejected by dev ops. you need to perform a manual logout from Microsoft live so that the login prompt will ask you if you want to login with the private or company account. choose the right one and it works.

Odd. My account has only ever been an Office Live 365 (Azure AD) account that was added to a client's VS.com org. Sounds like an issue with MSFT identity not being able to resolve things internally.

@edgariscoding
Copy link

Same issue here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants