Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single sign-on for a .NET desktop application (Google, Yahoo, Facebook ...)

I need to provide a login mechanism in my application. I'd would like to provide login for the most common IPs, such as Google, Yahoo!, Facebook, Microsoft Live and others.

My application is a Desktop application written in C#, so is not a Web application.

  • Do you know any library or framework that I could use to achieve this purpose.
  • Must I implement a sign-on mechanism for each provider?

NOTE: I know that Microsoft provides a unique sign-on mechanism in Azure, but I'm not interested in this Azure service.

like image 866
Daniel Peñalba Avatar asked Mar 07 '13 14:03

Daniel Peñalba


1 Answers

OpenAuth will do what you need, but it can be complicated to use. There are an abundance of resources to help you, though. Here is a link to an article describing the process of using OAuth, and there is an excellent SO answer Here with code samples you can use to get started.

You will need to register with the services you'd like to use for sign on and receive a key for them. Quoted from the linked article:

  1. Register your app with the service that you are developing it for. e.g. Twitter, Twitpic, SoundCloud etc. You will receive a consumer key and secret.
  2. You, the developer of the app then initiates the OAuth process by passing the consumer key and the consumer secret
  3. The service will return a Request Token to you.
  4. The user then needs to grant approval for the app to run requests.
  5. Once the user has granted permission you need to exchange the request token for an access token.
  6. Now that you have received an access token, you use this to sign all http requests with your credentials and access token.

Though you will need a key from each provider, the method of authentication will be the same, so you will not actually need to implement separate sign on code specific to each service provider.

like image 199
BinaryTox1n Avatar answered Oct 02 '22 14:10

BinaryTox1n