~petrus/mailctl-discuss

2 2

Invalid Request (0365)

Details
Message ID
<d48dae5a-c7e6-4ccb-90b9-6922f6bf61d8@protonmail.com>
DKIM signature
missing
Download raw message
Hi all,

I'm having difficulty getting this going with my company account. I put 
in the following:

# mailctl authorize microsoft abc@efghi.com --debug

I go http://localhost:8081 (I use port 8081 because I have something 
else on 8080), and upon being prompted, provide my password and then 
instantly get this
  in stderr and in the browser:
----------------------------------------------------------
localWebServer - invalid request

Request
     { requestMethod = "POST"
     , httpVersion = HTTP/1.1
     , rawPathInfo = "/common/login"
     , rawQueryString = ""
     , requestHeaders =
         [
             ( "Host"
             , "localhost:8081"
             )
         ,
             ( "Connection"
             , "keep-alive"
             )
         ,
             ( "Content-Length"
             , "1408"
             )
         ,
             ( "Cache-Control"
             , "max-age=0"
             )
         ,
             ( "sec-ch-ua"
             , ""Chromium";v="117", "Not;A=Brand";v="8""
             )
         ,
             ( "sec-ch-ua-mobile"
             , "?0"
             )
         ,
             ( "sec-ch-ua-platform"
             , ""Linux""
             )
         ,
             ( "Upgrade-Insecure-Requests"
             , "1"
             )
         ,
             ( "Origin"
             , "http://localhost:8081"
             )
         ,
             ( "Content-Type"
             , "application/x-www-form-urlencoded"
             )
         ,
             ( "User-Agent"
             , "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
             )
         ,
             ( "Accept"
             , 
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
             )
         ,
             ( "Sec-Fetch-Site"
             , "same-origin"
             )
         ,
             ( "Sec-Fetch-Mode"
             , "navigate"
             )
         ,
             ( "Sec-Fetch-User"
             , "?1"
             )
         ,
             ( "Sec-Fetch-Dest"
             , "document"
             )
         ,
             ( "Referer"
             , "http://localhost:8081/"
             )
         ,
             ( "Accept-Encoding"
             , "gzip, deflate, br"
             )
         ,
             ( "Accept-Language"
             , "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7"
             )
         ,
             ( "Cookie"
             , "brcap=0; 
MicrosoftApplicationsTelemetryDeviceId=ccb3140e-62f4-44a2-bbea-b05d0fd86f53; 
ai_session=5myD9rwR/1nPv9DswTFUBi|1694729297423|1694730808192; 
wlidperf=FR=L&ST=1694731010051"
             )
         ,
             ( "dnt"
             , "1"
             )
         ,
             ( "sec-gpc"
             , "1"
             )
         ]
     , isSecure = False
     , remoteHost =
         [ ::1 ]:48618
     , pathInfo =
         [ "common"
         , "login"
         ]
     , queryString = []
     , requestBody =
     , vault =
     , requestBodyLength = KnownLength 1408
     , requestHeaderHost = Just "localhost:8081"
     , requestHeaderRange = Nothing
     }
Details
Message ID
<uzz6by4aaaaedajpg24slwibrsh3nhrhtqbcay6dw474hduvi5@6jaaqmfvcfti>
In-Reply-To
<d48dae5a-c7e6-4ccb-90b9-6922f6bf61d8@protonmail.com> (view parent)
DKIM signature
missing
Download raw message
On Thu, Sep 14, 2023 at 10:52:28PM +0000, Jake van der Kolk wrote:
> # mailctl authorize microsoft abc@efghi.com --debug
> 
> I go http://localhost:8081 (I use port 8081 because I have something 
> else on 8080), and upon being prompted, provide my password and then 
> instantly get this

Try to follow the extra steps suggested in the Readme for Microsoft
company accounts. Also browse the mailing list for how people dealt with
such accounts. Some succeeded, others did not.

I don't have Microsoft account so cannot really help you with more than
this.
Details
Message ID
<24ce26c6-045d-4a6b-b595-cb8c23527e2d@gmail.com>
In-Reply-To
<uzz6by4aaaaedajpg24slwibrsh3nhrhtqbcay6dw474hduvi5@6jaaqmfvcfti> (view parent)
DKIM signature
missing
Download raw message
Hi,
As discussed in another thread (”Re-direct to institution auth 
(Microsoft 365) not working”), this may have to do with the 
CORS-situation of the organizations Single Sign-On (SSO).

I had success doing the authorization flow in a browser with disabled 
web security (CORS checks etc.)

I launched chromium like this:
chromium --disable-web-security --user-data-dir=/tmp/chromium-tmp
and then opened http://localhost:8080 there.

There is apparently no similar way of doing this in firefox.

Best,
Anders Johansson
Reply to thread Export thread (mbox)