Giter VIP home page Giter VIP logo

nemiro.oauth.loginforms's Introduction

Nemiro.OAuth.LoginForms

Nemiro.OAuth.LoginForms is a class library that contains ready-to-use OAuth authorization forms for Windows Forms projects (.NET Framework).

It is an independent part of the Nemiro.OAuth project.

Nemiro.OAuth.LoginForms is licensed under the Apache License Version 2.0.

To install Nemiro.OAuth.LoginForms, run the following command in the Package Manager Console:

PM> Install-Package Nemiro.OAuth.LoginForms

System Requirements

  • Nemiro.OAuth v1.13 or later;
  • .NET Framework 3.5, 4.0, 4.5, 4.6 or 4.7;
  • Windows Forms.

License

Nemiro.OAuth.LoginForms is distributed under Apache License Version 2.0.

How to use

Create an authorization form for a provider OAuth. Use the Client ID and Secret Key that you received from the provider.

For example, DropBox:

C#

// create login form
var login = new DropboxLogin
(
  clientId     : "5nkunr8uscwfoba", 
  clientSecret : "n7x9icfwoe6dehq", 
  returnUrl    : "https://oauthproxy.nemiro.net/",
  autoLogout   : false,
  loadUserInfo : false
);

login.Owner = this;

// show login form
login.ShowDialog();

// authorization is success
if (login.IsSuccessfully)
{
  // use the access token for requests to API
  MessageBox.Show(login.AccessToken.Value);
}

Visual Basic .NET

' create login form
Dim login As New DropboxLogin _
(
  clientId     := "5nkunr8uscwfoba", 
  clientSecret := "n7x9icfwoe6dehq", 
  returnUrl    := "https://oauthproxy.nemiro.net/",
  autoLogout   := False,
  loadUserInfo := False
)

login.Owner = Me

' show login form
login.ShowDialog()

' authorization is success
If login.IsSuccessfully Then
  ' use the access token for requests to API
  MessageBox.Show(login.AccessToken.Value)
End If

Localization

Use the resources localization for different languages.

For example:

  • /ru/Nemiro.OAuth.LoginForms.resources.dll
  • /de/Nemiro.OAuth.LoginForms.resources.dll
  • Nemiro.OAuth.LoginForms.dll

This example will use the English (default), Russian and German.

See Also

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.