Hi
This is quite difficult to explain my issue but Ill give it a try.
We have a working implementation where we log into Imap using a token:
Imap.Login(Token, ImapAuthentication.OAuth20)
We get the token using the examle found here: RebexExtras/Office365_OAuth2/
So the user logs in, a token is returned and we format the token like this
Dim pattern As String = String.Format("user={0}{1}auth=Bearer {2}{1}{1}", "user@domain.com", ChrW(1), result.AccessToken)
Dim Token As String = Convert.ToBase64String(Encoding.ASCII.GetBytes(pattern))
This works.
Now we want to log in using a token that we retrieve using a client secret (no user login). Using the clientid, secret and the aadUrl I am able to get an access token. The scope I use here is **https://graph.microsoft.com/.default** so the scope is different because it need to include ".default" I format the token the same way as above before I pass it.
However when we do this we are unable to log in, the message returned is: AUTHENTICATE failed (NO).
Could you possibly point us in a direction to look? Is it a pure right issue in Outlook.Office365.com? Any pointers is appreciated.