views:

76

answers:

1

I want to do this when the app loads, so I can either ask the user to log in (if not authenticated) or else continue.

The only way I can think of is to call a random request (a GET that requires authentication) and check whether or not I get a valid response, but this seems inelegant. I am using the Foursquare API.

Are there better ways to do this?

A: 

There's a test method at http://api.foursquare.com/v1/test, but it works without authorisation. You could try sending an authenticated request to that endpoint and see if invalid credentials get rejected or just ignored.

ceejayoz