ChannelSurf icon indicating copy to clipboard operation
ChannelSurf copied to clipboard

Stuck at the place right after the authentication.

Open nati4193 opened this issue 5 years ago • 9 comments

I also stuck on this step. I already cleared for all step following manual but I have no idea what should I do after this to import my export slack data to Team.


Hi Guys, I am stuck at the place right after the authentication. I can successfully sign in in the command prompt. like below

“Let's get started! Sign in to Microsoft with your Teams credentials: To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code *** to authenticate. You've successfully signed in. Welcome ***”

Then nothing happens afterwards... Any idea why?

The thing I am suspecting now is the permission to "read/write all groups". To get that permission, it needs grant by the admin of the organization...how do you guys get that...

I appreciate your help.

Originally posted by @mengyuw-github in https://github.com/tamhinsf/ChannelSurf/issues/16#issuecomment-522178863

nati4193 avatar Nov 15 '19 15:11 nati4193

same here, it just says You've successfully signed in. and I signed in using the global admin account. Not sure what am I missing

Any help is much appreciated.

Aysan-kore avatar Mar 17 '20 23:03 Aysan-kore

Seems the same here, only I get an additional error: "The request body must contain the following parameter: 'client_assertion' or 'client_secret'."

****************************************************************************************************
Let's get started! Sign in to Microsoft with your Teams credentials:
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code CDKY7HEY4 to authenticate.

Unhandled Exception: System.AggregateException: One or more errors occurred. (AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.
Trace ID: 5f87231c-3305-4458-be34-98e107cb6200
Correlation ID: 7b50fcc1-782e-4982-ba8b-0f0f9d26d53d
Timestamp: 2020-03-19 14:48:49Z) ---> Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.
Trace ID: 5f87231c-3305-4458-be34-98e107cb6200
Correlation ID: 7b50fcc1-782e-4982-ba8b-0f0f9d26d53d
Timestamp: 2020-03-19 14:48:49Z ---> System.Net.Http.HttpRequestException:  Response status code does not indicate success: 401 (Unauthorized). ---> System.Exception: {"error":"invalid_client","error_description":"AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.\r\nTrace ID: 5f87231c-3305-4458-be34-98e107cb6200\r\nCorrelation ID: 7b50fcc1-782e-4982-ba8b-0f0f9d26d53d\r\nTimestamp: 2020-03-19 14:48:49Z","error_codes":[7000218],"timestamp":"2020-03-19 14:48:49Z","trace_id":"5f87231c-3305-4458-be34-98e107cb6200","correlation_id":"7b50fcc1-782e-4982-ba8b-0f0f9d26d53d","error_uri":"https://login.microsoftonline.com/error?code=7000218"}
   --- End of inner exception stack trace ---
   at Microsoft.IdentityModel.Clients.ActiveDirectory.HttpClientWrapper.<GetResponseAsync>d__30.MoveNext()
   --- End of inner exception stack trace ---
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AdalHttpClient.<GetResponseAsync>d__21`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AdalHttpClient.<GetResponseAsync>d__20`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenHandlerBase.<SendHttpMessageAsync>d__67.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenHandlerBase.<SendTokenRequestAsync>d__64.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenByDeviceCodeHandler.<SendTokenRequestAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenHandlerBase.<RunAsync>d__55.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenByDeviceCodeAsync>d__24.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at ChannelSurfCli.Program.UserLogin() in /home/janis/Darbs/migrat/ChannelSurf/ChannelSurfCli/Program.cs:line 191
   at ChannelSurfCli.Program.Main(String[] args) in /home/janis/Darbs/migrat/ChannelSurf/ChannelSurfCli/Program.cs:line 108

JanisE avatar Mar 19 '20 14:03 JanisE

I could fix this issue by https://github.com/tamhinsf/ChannelSurf/issues/20#issuecomment-522174788

passed this error and faced another one , after selecting the destination team I see this error message : Enter the destination Team number or type "new" to create a new Team: 5 Team ID is 3b8796bd-1b29-4a57-b166-d7c994f64631 Creating temp directory for Slack archive decompression Temp path is C:\Users\MYUSERNAME\AppData\Local\Temp\tmpD93A.tmp

Unhandled Exception: System.NotSupportedException: The given path's format is not supported. at System.IO.Path.GetFullPath(String path) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync) at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding) at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, Encoding entryNameEncoding) at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName) at ChannelSurfCli.Utils.Files.DecompressSlackArchiveFile(String zipFilePath, String tempPath) in C:\Temp\ChannelSurfCli\Utils\Files.cs:line 26 at ChannelSurfCli.Program.Main(String[] args) in C:\Temp\ChannelSurfCli\Program.cs:line 135

Aysan-kore avatar Mar 19 '20 15:03 Aysan-kore

Thanks, it worked for me, too.

I have a next error, too, but it's different to yours. :) My temp directory is "/tmp/tmpf0ZHvu.tmp", on Linux, and there is no exception there.

I got "Tenant does not have a SPO license" error yesterday, and today it's yet a different problem:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at ChannelSurfCli.Utils.Channels.CreateChannelsInMsTeams(String aadAccessToken, String teamId, List`1 slackChannels, String basePath)

Such a mess! :)

JanisE avatar Mar 20 '20 09:03 JanisE

I also stuck on this step. I already cleared for all step following manual but I have no idea what should I do after this to import my export slack data to Team. same here, the console client just stop.

So I looked in the code and found here a commented out debug line:

# ChannelSurfCli/Utils/Channels.cs:199-208

        public static string SelectJoinedTeam(string aadAccessToken)
        {
            MsTeams.Team msTeam = new MsTeams.Team();

            Helpers.httpClient.DefaultRequestHeaders.Clear();
            Helpers.httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", aadAccessToken);
            Helpers.httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            var httpResponseMessage =
                    Helpers.httpClient.GetAsync(O365.MsGraphBetaEndpoint + "me/joinedTeams").Result;
            Console.WriteLine("httpResponseMessage is  " + httpResponseMessage.Content.ReadAsStringAsync().Result);

after uncommenting that I'm getting

Let's get started! Sign in to Microsoft with your Teams credentials:
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXXXXXXX to authenticate.
You've successfully signed in.  Welcome XXXXXXXXXXXXX
httpResponseMessage is  {
  "error": {
    "code": "UnknownError",
    "message": "",
    "innerError": {
      "request-id": "7088ba13-4fb5-4705-861b-XXXXXXXXXXX",
      "date": "2020-04-02T19:36:51"
    }
  }
}

after that application just exits with 0 code, I assume I have messed something up in Azure AD, any tips here?

aboritskiy avatar Apr 02 '20 19:04 aboritskiy

ok, after a bit of debugging, turns out my problem was an easy one: I messed up Azure permissions.

What helped me is this URL: https://docs.microsoft.com/en-us/graph/api/user-list-joinedteams?view=graph-rest-1.0&tabs=http#permissions One must grant those permissions in Azure, it started working for me once I granted those as delegated. Maybe I was reading ReadMe with not enough attention, but initially I assigned not delegated permissions, not sure if that is important here.

Hope that helps someone else

aboritskiy avatar Apr 02 '20 20:04 aboritskiy

i think above solution and https://github.com/tamhinsf/ChannelSurf/issues/20 both should be applied to make it works.

In Azure Click on "ChannelSurfCli", in the page where you get the IDs click "Supported account types: Multiple organizations" find "default client type, treat application as a public client": change to yes.

vipulsatyanam avatar Jul 18 '20 07:07 vipulsatyanam

Did anyone manage to get passed the "you've successfully signed in" message?

orappold avatar Jul 21 '20 16:07 orappold

Make sure you have one of these permissions as @aboritskiy mentioned. From my side, to be sure I've included all Application and Delegated permissions listed here: Screenshot 2021-04-19 at 15 20 48

pito-svk avatar Apr 19 '21 13:04 pito-svk