Exchange Web Services .NET > Tutorial > Authentication for Microsoft 365 - OAuth2 authentication using device code

The following example shows you how to use OAuth2 authentication with device code. In order to use OAuth2 authentication you need client id and tenant from your app registration (you have to add and register your application using the App registrations experience in the Azure portal if is not already registered).

C# example
VB example

Need help? Ask our developers: