Click here to Skip to main content
15,441,020 members
Home / Discussions / Cloud Computing
   

Cloud Computing

 
QuestionLogging in to Tiki Wiki on Azure Pin
jsc427-Jan-22 5:29
professionaljsc427-Jan-22 5:29 
QuestionCan a SignalR chat "hub" be hosted on AWS/LightSail? Pin
victorbos27-Jan-21 4:14
Membervictorbos27-Jan-21 4:14 
AnswerMessage Closed Pin
15-Mar-21 4:06
MemberJhonalbert15-Mar-21 4:06 
AnswerRe: Can a SignalR chat "hub" be hosted on AWS/LightSail? Pin
Leeladhar Ladia25-Mar-22 3:11
MemberLeeladhar Ladia25-Mar-22 3:11 
QuestionSFC allocation in CloudSim Pin
Member 147774293-Jan-21 1:30
MemberMember 147774293-Jan-21 1:30 
QuestionWhich Cloud vendor chooses for the service website? Pin
William.Front-end3-Sep-20 0:48
MemberWilliam.Front-end3-Sep-20 0:48 
AnswerRe: Which Cloud vendor chooses for the service website? Pin
Afzaal Ahmad Zeeshan3-Sep-20 5:13
mveAfzaal Ahmad Zeeshan3-Sep-20 5:13 
GeneralRe: Which Cloud vendor chooses for the service website? Pin
William.Front-end8-Sep-20 0:47
MemberWilliam.Front-end8-Sep-20 0:47 
AnswerRe: Which Cloud vendor chooses for the service website? Pin
ZurdoDev15-Oct-20 6:45
professionalZurdoDev15-Oct-20 6:45 
AnswerRe: Which Cloud vendor chooses for the service website? Pin
MobilHead6-Aug-21 1:08
MemberMobilHead6-Aug-21 1:08 
AnswerRe: Which Cloud vendor chooses for the service website? Pin
Michael Donald29-Nov-21 21:08
professionalMichael Donald29-Nov-21 21:08 
AnswerRe: Which Cloud vendor chooses for the service website? Pin
Member 155103601-Jun-22 4:56
MemberMember 155103601-Jun-22 4:56 
QuestionMigrate shared hosting ASP.Net site(s) to Azure Pin
DerekT-P18-Jul-20 23:28
professionalDerekT-P18-Jul-20 23:28 
AnswerRe: Migrate shared hosting ASP.Net site(s) to Azure Pin
Afzaal Ahmad Zeeshan3-Sep-20 5:24
mveAfzaal Ahmad Zeeshan3-Sep-20 5:24 
GeneralRe: Migrate shared hosting ASP.Net site(s) to Azure Pin
DerekT-P3-Sep-20 23:41
professionalDerekT-P3-Sep-20 23:41 
GeneralRe: Migrate shared hosting ASP.Net site(s) to Azure Pin
Afzaal Ahmad Zeeshan4-Sep-20 3:57
mveAfzaal Ahmad Zeeshan4-Sep-20 3:57 
QuestionOffice 365 + IMAP + OAuth2 [Solved] Pin
Richard Deeming15-Apr-20 4:03
mveRichard Deeming15-Apr-20 4:03 
We currently have an intranet portal which uses IMAP to read email from a shared mailbox on Office365, using the excellent MailKit[^] library.

I've just been made aware that Microsoft is going to disable basic authentication for IMAP clients. Originally, this was going to happen in October, but it's since been pushed back to the second half of 2021.

Basic Auth and Exchange Online – February 2020 Update - Microsoft Tech Community - 1191282[^]

After some panicked reading and experimentation (and much swearing), I've managed to get the MSAL[^] library to return an OAuth2 access token:
C#
const string ClientId = "...";
const string Username = "...";
SecureString password = ...;

var scopes = new[] { "https://outlook.office365.com/.default" };
var app = PublicClientApplicationBuilder.Create(ClientId).WithAuthority(AadAuthorityAudience.AzureAdMultipleOrgs).Build();
var tokenResult = await app.AcquireTokenByUsernamePassword(scopes, Username, password).ExecuteAsync(cancellationToken);
After configuring the application as a "public client" in the Azure portal, giving it Mail.ReadWriteAll and Mail.SendAll permissions, and granting admin consent for my organisation, this code now returns a seemingly-valid access token.

According to the author of the MailKit library[^], all I need to do now is use the token to authenticate:
C#
using var client = new ImapClient();
await client.ConnectAsync("outlook.office365.com", 993, SecureSocketOptions.Auto, cancellationToken);
await client.AuthenticateAsync(new SaslMechanismOAuth2(Username, tokenResult.AccessToken), cancellationToken);
Unfortunately, that simply throws an "authentication failed" exception.
MailKit.Security.AuthenticationException
  HResult=0x80131500
  Message=Authentication failed.
  Source=MailKit
  StackTrace:
   at MailKit.Net.Imap.ImapClient.<AuthenticateAsync>d__81.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at TestOffice365OAuth.Program.<MainAsync>d__1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at TestOffice365OAuth.Program.Main()
I don't know whether this is a bug in Microsoft's implementation, a bug in MailKit, a configuration error with my application, or a mistake in my code.

Has anyone managed to get Office365 IMAP access working with OAuth2? Can you spot anything I've missed?



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


modified 28-Apr-20 6:21am.

AnswerRe: Office 365 + IMAP + OAuth2 Pin
Richard Deeming20-Apr-20 0:41
mveRichard Deeming20-Apr-20 0:41 
AnswerRe: Office 365 + IMAP + OAuth2 Pin
Richard Deeming28-Apr-20 0:21
mveRichard Deeming28-Apr-20 0:21 
QuestionASP.NET + Multi Form using Textbox problem Pin
kerek224-Feb-20 21:42
Memberkerek224-Feb-20 21:42 
AnswerRe: ASP.NET + Multi Form using Textbox problem Pin
Richard MacCutchan24-Feb-20 23:17
mveRichard MacCutchan24-Feb-20 23:17 
QuestionAzure Data Factory pipeline into compressed Parquet file: “java.lang.OutOfMemoryError:Java heap space” Pin
VictorSotnikov16-Sep-19 10:20
MemberVictorSotnikov16-Sep-19 10:20 
QuestionHow to search for a word or color on a website? Pin
l@rs_30-Aug-19 8:17
Memberl@rs_30-Aug-19 8:17 
AnswerRe: How to search for a word or color on a website? Pin
Afzaal Ahmad Zeeshan30-Aug-19 12:02
mveAfzaal Ahmad Zeeshan30-Aug-19 12:02 
AnswerRe: How to search for a word or color on a website? Pin
Member 1502871723-Dec-20 1:45
MemberMember 1502871723-Dec-20 1:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.