Question How to handle OAuth2 authentication?

Nathaniel

New member
Joined
Dec 27, 2021
Messages
2
Programming Experience
3-5
Good morning!
I am fairly new to C# app programming and I am working on developing an app that accesses an API that uses OAuth2 to authenticate.
Can someone please share some code examples of how to perform the OAuth2 authentication process in a C# app using a custom URL scheme such as test://callback for the redirect URI.
Thank you for any help you can provide!
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
4,431
Location
Chesapeake, VA
Programming Experience
10+
Unless you are specifically trying to learn how OAuth2 works and how to use it, it is typically better to use an establish OAuth2 library that will do the appropriate protocol handshaking for you. If you truly are trying to learn OAuth2, then asking for other people for code is the wrong approach. The correct approach is to try to implement it yourself using the specs. You learn very little from just running someone else's code unless you are truly honest with yourself and will actually step through the code line by line along side with running a packet sniffer or a web proxy monitor to view the protocol as it is exercised.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
4,431
Location
Chesapeake, VA
Programming Experience
10+
Top Bottom