Check whether user is logged in to Free Agent site or not

Hi there,

I am using .NET API from here https://github.com/nicwise/FreeAgent.

Currently I am working on logging the user in and access the details. I am
using the same process used in Google OAuth 2.0 Playgroud.

The problem with me is that It always asks for Approval. Does Free Agent
provide any API call so user don’t have to ALLOW all the time they login to
my site using their Free Agent account?

Also second problem is that ‘Can I check whether the user is logged into
Free Agent site or not using API’? I want to check if the user is logged in
to Free Agent site, I want to access information without asking for login.

My code is as below.

FreeAgentClient.UseSandbox = true;
_client = new FreeAgentClient(_apiKey, _apiSectet);
string callbackUri = “http://www.example.com/redirect.aspx”;
string url = _client.BuildAuthorizeUrl(callbackUri);

Then on redirect.aspx, I get the code (from the querystring) and can get
the access token and access the details I need.

I want,

  1. User don’t have to allow all the time and
  2. Check whether user is logged in to Free Agent site so that I can proceed
    further.

Thanks

Hi Sanjay,

To answer your questions:

  1. User don’t have to allow all the time

You can store the refresh and access tokens you retrieve from the FreeAgent
API and then use them to access the API whenever the user accesses your
site. That way the user only has to authorise your app once. The access
tokens expire after 1 week, the refresh tokens don’t expire. You can use
the refresh token to get a new access token by following the instructions
here: FreeAgent Developer Dashboard

  1. Check whether user is logged in to Free Agent site so that I can
    proceed further.

There is no way to tell if a user is logged into the FreeAgent app using
the API. It is not necessary for the user to be logged into the FreeAgent
app for your app to use the API access tokens you already have.

Kind regards,

GraemeOn 26 May 2014 14:47, Sanjay Panchal spanchal@kairasoftware.com wrote:

Hi there,

I am using .NET API from here GitHub - nicwise/FreeAgent: A basic .NET client for FreeAgent.com (work in progress).

Currently I am working on logging the user in and access the details. I am
using the same process used in Google OAuth 2.0 Playgroud.

The problem with me is that It always asks for Approval. Does Free Agent
provide any API call so user don’t have to ALLOW all the time they login to
my site using their Free Agent account?

Also second problem is that ‘Can I check whether the user is logged into
Free Agent site or not using API’? I want to check if the user is logged in
to Free Agent site, I want to access information without asking for login.

My code is as below.

FreeAgentClient.UseSandbox = true;
_client = new FreeAgentClient(_apiKey, _apiSectet);
string callbackUri = “http://www.example.com/redirect.aspx”;
string url = _client.BuildAuthorizeUrl(callbackUri);

Then on redirect.aspx, I get the code (from the querystring) and can get
the access token and access the details I need.

I want,

  1. User don’t have to allow all the time and
  2. Check whether user is logged in to Free Agent site so that I can
    proceed further.

Thanks


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

Graeme Boyd
Engineering Manager

Web. freeagent.com http://www.freeagent.com/ Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent https://twitter.com/#!/freeagent Facebook.
FreeAgent | Edinburgh

40 Torphichen Street, Edinburgh, EH3 8JB
FreeAgent Central Ltd. Registered in sunny Scotland SC316774