-
Notifications
You must be signed in to change notification settings - Fork 60
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
Outlook Connection/Redirection Error #4
Comments
Hmm, that's odd, I have not encountered that scenario yet when trying to access a mailbox through the cloud/office365-based Outlook application. Could you share the link that it displays? We might be able to get more information from that based on where it is trying to redirect you to. (If the link contains company information or user details which you don't want to share, feel free to substitute them with some placeholders like |
Absolutely, and thank you for getting back to me. The link is as follows: https://mail.example.com/owa/[email protected] Then it redirects for a long while before ultimately closing the connection. |
Alright, so it seems like Office365 is trying to redirect you to the OWA page of an on-prem exchange server. So I guess in this case, the user's mailbox would still be hosted on-prem, and would need to be accessed from there. Apparently, there used to be an option where it was possible to request mails from both on-prem and cloud mailboxes using the MsGraph API, however, it seems like that was retired somewhere last year: You can always try to see if you can still request any mails with custom MsGraph API requests either way. All you would need is an access token for https://graph.microsoft.com containing the scope |
I think you are right. It appears to be on-premises and RESTAPI is not enabled When I run the custom request (with the required access token and scopes), I get the following response
What would you advise? |
I think you are out of luck then. I don't think there is any way you will be able to get direct access to the mailbox by using access/refresh tokens from Entra ID if the mailbox is hosted on-prem. So you will have to assess what other options you have and work with that instead. E.g. Does the user use other Office365 apps you can do something with (Microsoft Teams, SharePoint, OneDrive, ...)? You can enumerate information from Entra ID using the MsGraph API or the AAD Graph API (e.g. if it is a large organization with a lot of users, you can try some password spraying against all accounts which you can extract from Entra ID. Or check if there are mobile phone numbers linked to accounts which you can target through Vishing, etc...) Depends on the scenario you are in and the scope of your assessment ofc, although the mailbox of this user will sadly be out of reach for you here if it is hosted on-prem. |
I truly appreciate this guidance. The outlook issue where the mailbox link never connects is quite confusing, considering that I am redirected to pages like "https://mail.example.com/owa/", and that several tokens I can produce have permissions like "EAS.AccessAsUser.All", "Ews.AccessAsUser.All", and "OWA.AccessAsUser.All" Based on this combination of factors, I can imagine the cause of the connection problem being something else, not being hosted on-prem. Do you have any ideas? One more question if you don't mind. For MFA methods, GraphSpy provides the following error message: I am using the correct resource (MicrosoftAppAccessPanel) Thank you and I will see what I can do ;) |
The To access the MFA methods, you need to make sure that you are using the v2 API version to request the token, and then I usually use the following settings:
You should then receive an access token with the resource (audience) of exactly You usually also need MFA claims to access that information. So in GraphSpy, check out the decoded token and see which values you have under the authentication methods (
If you have confirmed that all of that is correct, and you still get the error message |
Interesting. When I get the access token with the exact correct audience, the decoded token does not display "mfa" under amr. It instead displays:
The stack trace generated is: Would requesting an ngcmfa claim produce a different result? On the note of the possibility that the on-prem exchange server is being decommissioned, I can with certainty that I know the website is in existence and operating. My current theory on my inability to access is geoblocking (based on my current location, the requested device login location, and/or the user recipient location, or VPN usage. |
Alright, then that seems to be the issue indeed. The user used single-factor authentication with only their password during the device code auth process. The fact that this is allowed is usually already a finding, especially if the device code was generated from a different country as you mentioned and not from a trusted location. You can force the user to use MFA during the device code authentication by requesting the |
Hello, and thank you for producing such a great tool.
Upon trying to open Outlook, I am presented with a page that says "Use the following link to open this mailbox with the best performance:"
Upon clicking the link provided, the connection times out.
I have previously been able to open Outlook in prior testing of other accounts. I am also able to access the rest of the tools without issue, changing access tokens and Client IDs as required.
How should I go about accessing Outlook in browser? Or if not possible with the account I am currently testing, would a custom Graph request to dump inbox be my alternative solution?
Thank you and I look forward to hearing back.
The text was updated successfully, but these errors were encountered: