OAuth 2.0 in Windows and ASP.NET MVC apps
You can use MailBee.NET Objects to check and send mail via OAuth 2.0 with Google and Microsoft providers including Gmail, Outlook.com, Live.com, Hotmail.com. In the future, if more providers implement XOAUTH2 extension in their IMAP and SMTP protocols, they will be supported as well.
OAuth 2.0 is a complex topic, and this tutorial aims to address as many concerns as possible, including:
- Registering projects on Google and Microsoft web sites.
- Support of Google Service Accounts (which makes it very easy to use OAuth 2.0 with Google Apps).
- Google API and DotNetOpenAuth usage.
- Getting the e-mail address and name of the user.
- IMAP and SMTP access to the user's account via XOAUTH2 authentication.
- Compatibility with OWIN/Katana and ASP.NET Identity 2.0 in ASP.NET MVC5 applications.
- Configuring IIS Express to simplify local development of OAuth-enabled web applications, with HTTPS support.
- Refreshing access tokens to enable long-lived applications.
- Exchanging access tokens between ASP.NET and non-web applications (for background applications doing periodic activity in a user's mailboxes without that user's interaction).
- Asynchronous and synchronous versions of the code (if possible).
- For desktop and console applications, automating the process of passing the authorization code from the provider's web site to the application (instead of a user's manual input).
All the samples are available for both C# and VB and target .NET Framework v4.5.1.
ASP.NET samples require Visual Studio 2013 Update 3 or higher (they are using the latest version of ASP.NET MVC template, MVC5 at the moment of writing).
Installed applications (console and WinForms samples) require Visual Studio 2012 at least.
Please select the article which corresponds your case:
All C# and VB samples discussed in this tutorial are shipped with MailBee.NET Objects installer and get installed into My Documents\MailBee.NET Objects\Samples folder.
Send feedback to AfterLogic
Copyright © 2006-2015 AfterLogic Corporation. All rights reserved.