Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck at the place right after the authentication. #23

Open
nati4193 opened this issue Nov 15, 2019 · 9 comments
Open

Stuck at the place right after the authentication. #23

nati4193 opened this issue Nov 15, 2019 · 9 comments

Comments

@nati4193
Copy link

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 #16 (comment)

@Aysan-kore
Copy link

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.

@JanisE
Copy link

JanisE commented Mar 19, 2020

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

@Aysan-kore
Copy link

I could fix this issue by
#20 (comment)

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

@JanisE
Copy link

JanisE commented Mar 20, 2020

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! :)

@aboritskiy
Copy link

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
Copy link

aboritskiy commented Apr 2, 2020

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

@vipulsatyanam
Copy link

i think above solution and #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.

@orappold
Copy link

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

@pito-svk
Copy link

pito-svk commented Apr 19, 2021

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

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

No branches or pull requests

7 participants