Click here to Skip to main content
15,888,025 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

Good Day.

I have an windows C# application, i just want use outlook office 365 credentials to logon my application.is it any ways to integrate outlook office 365 account to my application.
Specifically i m looking for use login with outlook 365 email accounts to use login my application.
for example : email address: myuser1@myuser.com, with a password, the same account need to use login for my application. suppose myuser1 changed account password in 365, the new password can use to login into application. Any webservice method to login or any ways ?

And email account is access on the web, like https://outlook.office365.com/owa/myuser.com/

What I have tried:

I read this below article
https://www.c-sharpcorner.com/article/authentication-with-office-365-in-C-Sharp/
and mentioned use a webservice. but that wont work for me. and mentioned webservice is not available also
Posted
Updated 14-Sep-21 21:34pm

1 solution

I would use "Open ID Connect" - it is not Azure specific, but a standard implemented by any decent identity provider - including Azure AD. Preferably "Open ID Connect with PKSE" to be at the highest security level.

For example using this nuget package:
GitHub - IdentityModel/IdentityModel.OidcClient: Certified C#/NetStandard OpenID Connect Client Library for native mobile/desktop Applications (RFC 8252)[^]

Follow the link to the documentation and from there you can find samples for WPF, WinForm, Console, ...

It can be a bit tricky to get the configuration correct when you are new to the subject - and if it is wrong expect all you will get is "it did not work, try something else" error messages. So reserve a lot of time for that part - but the actual code should be very simple.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900