Your comments
You can manually change the Organization ("Account") in the Azure DevOps account dialog. But as pointed out in my last comment, I hope to get rid of the Account entirely. Can you please give the clone, as outlined above, a try?
I'm wondering whether we need accounts/usernames at all. OAuth tokens/PATs already seem to uniquely identify the users. I couldn't find any official statement in the REST API docs about this, but I found the following:
https://github.com/MicrosoftDocs/azure-devops-docs/issues/2455#issuecomment-439503194
The same is also true for GitHub, Bitbucket and GitLab. For my experiments, I could now also successfully use the OAuth token and a PAT to access repositories of my two test organizations. For PATs, it's important to give them access to "All accessible organizations"; scope Code Read&Write should be sufficient.
@hrant and @Martillo, can you please confirm that you are able to access all of your (private) repositories when creating such a PAT:
git clone https://anything:<PAT>@dev.azure.com/yourOrgName/yourProjectName/_git/yourRepoName
Note that there is another bug in SmartGit's latest build which prevents PATs from working correctly (almost always), hence it's not yet expected to work from within SmartGit.
At which point would SmartGit get in touch with an "org.visualstudio.com"-URL? None of your above logs mentions "org.visualstudio.com".
> 2- Digging further on why I was not seeing the Azure logo on branches, it dawned on me that our organization still uses > the older visualstudio domain format
> `https://org.visualstudio.com` instead of `https://dev.azure.com/org`
Do you think that this could be a common problem? Any ideas how SmartGit could detect this problem?
:D That is really good to hear! Hence, from my understanding following issues are still open:
- some error messages are still mentioning "Bitbucket"
- the rundll32-link should better be encoded: it seems encoded version is working for all of us with all browser
- improve "no refresh-token present" error message
- personal access tokens: I can reproduce the 401 for "https://app.vssps.visualstudio.com/_apis/profile/profiles/me" now -- I guess since introducing that call I didn't check again with PATs, sorry for that ...
That looks good! Currently, SmartGit is populating the "Account" field with the first account from this list. Maybe it should better offer a list to chose from?
Did you also try to click the Generate Token button instead of copy&pasting the URL to the browser directly? It will invoke rundll32 exactly you did, hence I would expect this to work, too.
Regarding pull requests, the Branches view doesn't show any of them, but it also doesn't denote any errors in the Azure logo. Is it correct that the repository doesn't contain any pull requests?
> Correct, it turns out that smartgit passing url to browser is running into an issue and concatenating multiple times.
> here's how the urldecoded version looks like what is actually passed to the browser.
That's interesting. I'm on Windows 10 and don't have any troubles with passing over url-decoded version to rundll32 (the partial duplication is expected and required). From command line, can you please try to run following commands and let me know which ones of them succeed?
rundll32 url.dll,FileProtocolHandler "https://app.vssps.visualstudio.com/oauth2/authorize?client_id=8596D322-85D7-49ED-8103-77ABE77BD190&response_type=Assertion&state=nothing&scope=vso.code_write&redirect_uri=https://www.syntevo.com/smartgit/azuredevops-callback"
and:
rundll32 url.dll,FileProtocolHandler "https://app.vssps.visualstudio.com/oauth2/authorize?client_id=8596D322-85D7-49ED-8103-77ABE77BD190&response_type=Assertion&state=nothing&scope=vso.code_write&redirect_uri=https%3A%2F%2Fwww.syntevo.com%2Fsmartgit%2Fazuredevops-callback"
> if I copy the url shown in the dialog and paste that in the browser, I get a proper login dialog, and when I paste back the
> Authorization code, the Account field is filled with one of our organizations.
That's good. This is the result of https://app.vssps.visualstudio.com/_apis/accounts callback. When invoking this URL in your browser can you see multiple accounts there? Does that match the organizations you are connecting to?
> Now if we forget about the second org, and look into the first one that properly got added, I still don't see anywhere any traces of pull request.
Does the Branches view now show the Azure logo? Let's first concentrate to get this working for the organization which Generate Token suggests. Also let's switch to email. Please send clean logs for the seemingly successful authentication for this organization to smartgit@syntevo.com:
https://www.syntevo.com/doc/display/SG/Debugging#Debugging-Generaladvices/preparations
This call is not actually sent from SmartGit, but it's an URL which is passed to your browser. A "Request Too Long" is definitely not expected here. The URL looks identical for me (client_id is a constant) and it will finally result in opening the callback URL:
https://www.syntevo.com/smartgit/azuredevops-callback
What SmartGit is doing here is explained at:
https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops#authorize-your-app
Could this be some firewall issue in your company (network)?
Thanks, I'm going to fix the error message. Still, I can't reproduce your problem. Please send logs, as explained in my reply to hrant.
Customer support service by UserEcho
@hrant and @Martillo, thanks for your testing and feedback! I have now uploaded build 17071 (Help|Check for Latest Build) with following changes:
Note, that: