Click here to Skip to main content
15,881,092 members
Home / Discussions / Cloud Computing
   

Cloud Computing

 
QuestionHow to set up Minikube and get started with kubernetes? Pin
MoistMan20217-Mar-23 18:50
MoistMan20217-Mar-23 18:50 
QuestionLogging in to Tiki Wiki on Azure Pin
jsc427-Jan-22 5:29
professionaljsc427-Jan-22 5:29 
AnswerRe: Logging in to Tiki Wiki on Azure Pin
jschell19-Apr-23 5:20
jschell19-Apr-23 5:20 
GeneralRe: Logging in to Tiki Wiki on Azure Pin
jsc4219-Apr-23 23:27
professionaljsc4219-Apr-23 23:27 
QuestionCan a SignalR chat "hub" be hosted on AWS/LightSail? Pin
victorbos27-Jan-21 4:14
victorbos27-Jan-21 4:14 
AnswerMessage Closed Pin
15-Mar-21 4:06
Jhonalbert15-Mar-21 4:06 
AnswerRe: Can a SignalR chat "hub" be hosted on AWS/LightSail? Pin
Leeladhar Ladia25-Mar-22 3:11
Leeladhar Ladia25-Mar-22 3:11 
QuestionSFC allocation in CloudSim Pin
Member 147774293-Jan-21 1:30
Member 147774293-Jan-21 1:30 
QuestionWhich Cloud vendor chooses for the service website? Pin
William.Front-end3-Sep-20 0:48
William.Front-end3-Sep-20 0:48 
AnswerRe: Which Cloud vendor chooses for the service website? Pin
Afzaal Ahmad Zeeshan3-Sep-20 5:13
professionalAfzaal Ahmad Zeeshan3-Sep-20 5:13 
GeneralRe: Which Cloud vendor chooses for the service website? Pin
William.Front-end8-Sep-20 0:47
William.Front-end8-Sep-20 0:47 
GeneralRe: Which Cloud vendor chooses for the service website? Pin
Digital Meta15-Apr-24 20:42
Digital Meta15-Apr-24 20:42 
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
MobilHead6-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
Member 155103601-Jun-22 4:56 
AnswerRe: Which Cloud vendor chooses for the service website? Pin
Bohdan Stupak19-Apr-23 4:07
professionalBohdan Stupak19-Apr-23 4:07 
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
professionalAfzaal 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
professionalAfzaal 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 
GeneralRe: Office 365 + IMAP + OAuth2 [Solved] Pin
OriginalGriff6-Feb-24 21:18
mveOriginalGriff6-Feb-24 21:18 

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.