What is client library and how can i use it (.NET)


#1

Hello ,

I am working on a .NET Web Form application , I am reading the documentation and i notice the following

Client Libraries
Google OAuth Client Library for Java, Python, .NET, Ruby, PHP, Objective C

What is the purpose for Google OAuth Client Library
What is the best way to make the integration with free agent ??

I am trying to create request and get response using WebRequest class and i receive a response as expected but i don’t know about Google OAuth Client Library

i try to read about it but i am confused , please someone clarify

Thanks.


#2

Hi Bassem,

A client library is designed to make it easier for you to integrate your app with any service which requires OAuth to authenticate and allow access for users. We here at FreeAgent are unfamiliar with the Google library, but the principles of OAuth are the same:

  1. The user must have an account with FreeAgent
  2. Your application must be registered at https://dev.freeagent.com, and your client ID and secret should be available to your app.
  3. The user visits your application and selects to login with FreeAgent (if applicable). You then redirect the user to FreeAgent (sending the client ID as part of the URL) to authenticate and allow access for your app.
  4. If the user authenticates successfully they will be redirected back to your app (to a URI you specify) with an auth token
  5. Your app should then make a request (using HTTP basic auth of your client ID and secret) to FreeAgent’s API, passing in the auth token as a parameter. In return you will receive an access token which is valid for a set period of time, and a refresh token which can be used to obtain a new access token as and when the first one expires.
  6. Your app can then make requests to the FreeAgent API, passing the current access token in a header, to access and modify the user’s FreeAgent data as needed.

I hope that helps you understand things a bit better. If you are still unsure then the following links provide useful information:


https://dev.freeagent.com/docs/oauth

Kind Regards,
Paul