How to use the library in your projects?
Add to your project a reference to the Nemiro.OAuth assembly and import namespace Nemiro.OAuth and Nemiro.OAuth.Clients:
![](icons/CopyCode.gif)
using Nemiro.OAuth; using Nemiro.OAuth.Clients;
![](icons/CopyCode.gif)
Imports Nemiro.OAuth Imports Nemiro.OAuth.Clients
And now you can use classes of the library.
For example, registration the Twitter client in the application:
![](icons/CopyCode.gif)
OAuthManager.RegisterClient ( new TwitterClient ( "cXzSHLUy57C4gTBgMGRDuqQtr", "3SSldiSb5H4XeEMOIIF4osPWxOy19jrveDcPHaWtHDQqgDYP9P" ) );
![](icons/CopyCode.gif)
OAuthManager.RegisterClient _ ( New TwitterClient _ ( "cXzSHLUy57C4gTBgMGRDuqQtr", "3SSldiSb5H4XeEMOIIF4osPWxOy19jrveDcPHaWtHDQqgDYP9P" ) )
And obtaining addresses for authorization:
![](icons/CopyCode.gif)
string url = OAuthWeb.GetAuthorizationUrl("twitter");
![](icons/CopyCode.gif)
Dim url As String = OAuthWeb.GetAuthorizationUrl("twitter")
Verification of the authorization results by URL.
![](icons/CopyCode.gif)
var result = OAuthWeb.VerifyAuthorization("result url"); if (result.IsSuccessfully) { // ..successfully.. }
![](icons/CopyCode.gif)
Dim result As AuthorizationResult = OAuthWeb.VerifyAuthorization("result url") If result.IsSuccessfully Then ' ..successfully.. End If
And get user profile details.
![](icons/CopyCode.gif)
var user = result.UserInfo; // ...
![](icons/CopyCode.gif)
Dim user As UserInfo = result.UserInfo ' ...
In the description of the classes you can find more detailed examples.
If you need real examples of using the library, please download Nemiro.OAuth.