Skip to content

Can't connect to Outlook OAuth IMAP #81

@EthraZa

Description

@EthraZa

I have hijacked the issue #50 but I guess it's better to create a new one.

   $client = Client::make([
            'host' => 'outlook.office365.com',
            'port' => 993,
            'encryption' => 'ssl', // 'tls',
            'validate_cert' => false,
            'username' => 'xyz@outlook.com',
            'password' => 'AccessToken',
            'protocol' => 'imap',
            'authentication' => "oauth",
   ]);
  • User/pass on my email server works
  • Gmail OAuth works
  • Outlook OAuth don't

In the outlook webapp it says the IMAP info is:
Host: outlook.office365.com
Port: 993
Method: TLS

In the Azure panel, I have setup a Web authenticated App with Access Tokens and ID Tokens enabled, Live SDK Yes and Public client No.
With the following APIs permissions:

  • Microsoft Graph
    -- email
    -- IMAP.AccessAsUser.All
    -- offline_access
    -- openid
    -- profile
    -- User.Read

I'm getting the tokens via oauth2-azure plugin for PHP League's OAuth 2.0 Client setting the scope as 'openid profile email offline_access %root%/IMAP.AccessAsUser.All %root%/User.Read'.

The MS Activity Page shows only my ok browser logins, nothing to validate there.

I got Google OAuth IMAP working in the same day, but after almost a week, Outlook is driving me nuts.

With SSL encryption Webklex/php-imap returns "Connection setup failed" and logs out "NOTICE: PHP message: got failure response: NO AUTHENTICATE failed.".
With TLS secutity it hangs till time-out after Nginx 1 minute limit.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions