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.

Personal Access Token not working

See original GitHub issue

When using PAT in configuration.json, a login dialog (AAD) appears. I planned on using the migration tool in an Azure Devops Pipeline, but this is not possible if graphical user login is required. To my understanding, providing a Personal Access Token should prevent login dialogues from appearing. When login information is entered, the migration tool works as intended. If the dialog is canceled, the following exception is thrown:

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: You are not authorized to access https://****/. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Microsoft.VisualStudio.Services.Client.Controls.VssFederatedCredentialPrompt.<Microsoft.VisualStudio.Services.Common.IVssCredentialPrompt.GetTokenAsync>b__23_0(Task`1 t)
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Microsoft.VisualStudio.Services.Common.IssuedTokenProvider.GetTokenOperation.<GetTokenAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Common.IssuedTokenProvider.<GetTokenAsync>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.SendRequest()
   --- End of inner exception stack trace ---
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.SendRequest()
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpRequestChannel.Request(TfsMessage message, TimeSpan timeout)
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation, Object[] parameters, TimeSpan timeout, Object[]& outputs)
   at Microsoft.TeamFoundation.Framework.Client.LocationWebService.Connect(Int32 connectOptions, Int32 lastChangeId, Int32 features)
   at Microsoft.TeamFoundation.Framework.Client.FrameworkServerDataProvider.Connect(ConnectOptions connectOptions)
   at Microsoft.TeamFoundation.Client.TfsConnection.EnsureProviderConnected()
   at VstsSyncMigrator.Engine.TeamProjectContext.Connect() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\ComponentContext\TeamProjectContext.cs:line 70
   at VstsSyncMigrator.Engine.TeamProjectContext.get_Collection() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\ComponentContext\TeamProjectContext.cs:line 22
   at VstsSyncMigrator.Engine.WorkItemMigrationContext..ctor(MigrationEngine me, WorkItemMigrationConfig config) in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 46
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at VstsSyncMigrator.Engine.MigrationEngine.ProcessConfiguration(EngineConfiguration config) in D:\a\1\s\src\VstsSyncMigrator.Core\MigrationEngine.cs:line 87
   at VstsSyncMigrator.Engine.MigrationEngine..ctor(EngineConfiguration config) in D:\a\1\s\src\VstsSyncMigrator.Core\MigrationEngine.cs:line 33
   at VstsSyncMigrator.ConsoleApp.Program.RunExecuteAndReturnExitCode(RunOptions opts) in D:\a\1\s\src\VstsSyncMigrator.Console\Program.cs:line 211
   at VstsSyncMigrator.ConsoleApp.Program.<>c.<Main>b__5_1(RunOptions opts) in D:\a\1\s\src\VstsSyncMigrator.Console\Program.cs:line 131
   at CommandLine.ParserResultExtensions.MapResult[T1,T2,T3,TResult](ParserResult`1 result, Func`2 parsedFunc1, Func`2 parsedFunc2, Func`2 parsedFunc3, Func`2 notParsedFunc)
   at VstsSyncMigrator.ConsoleApp.Program.Main(String[] args) in D:\a\1\s\src\VstsSyncMigrator.Console\Program.cs:line 129

Source and Target look like that in configuration.json:

"Source": {
    "Collection": "https://dev.azure.com/organization1/",
    "Project": "origin",
    "ReflectedWorkItemIDFieldName": "ReflectedWorkItemId",
    "AllowCrossProjectLinking": false,
    "PersonalAccessToken": "***"
  },
  "Target": {
    "Collection": "https://dev.azure.com/organization1/",
    "Project": "target",
    "ReflectedWorkItemIDFieldName": "ReflectedWorkItemId",
    "AllowCrossProjectLinking": false,
    "PersonalAccessToken": "***"
  },

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
MrHinshcommented, Mar 17, 2020

This tool required UI integration. PAT tokens are only supported for images.

0reactions
MrHinshcommented, May 24, 2021

@f2calv it is more likely that the documentation is missing 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Personal Access Token in Github not working
I have a private repository that I have a dependency on, using https://github.com... in my package.json. I have ssh set up on my...
Read more >
Help! Personal Access Tokens not working : r/github
I'm attempting to push something to github but I get failed authentications, either cannot find username and password, or an error that says:....
Read more >
Seems like Personal Access Token is not working ...
Seems like Personal Access Token is not working suddenly when I do git push and pull.
Read more >
Personal Access Token in Confluence - Not working .. ...
it seems that Confluence is not recognizing the use of the PAT, as indicated by the "Last authenticated: Never" message in your settings....
Read more >
GitHub Personal Access Token not working
In SourceTree I open Preferences, click Accounts, click the GitHub account, click Edit and past the PAT into the password field. It appears...
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