1.) Is it possible to allow anonymous access to the REST APIs? I’m assuming “guest access” was this, but in testing, seeming not to be the case. I’ve checked off “Guest Access”, assigned a guest role and allowed GET access in the service definition. When I try to read passing in only the API app name, I receive back:
{"error":[{"context":null,"message":"Access to application ': rest-data' is not provisioned for this user's role.","code":403}]}
Is it possible to allow anonymous GET access? Am I using guest access correctly?
2.) Also, does DSP allow for “long-life tokens” or application tokens for API access? Instead of providing a username and password, then a token for that session, it is possible to generate a token that doesn’t expire and wouldn’t need username/password to generate?
On #2, the DSP allows guest access as you have noticed. All other access currently requires user authentication (via email/password or OAuth) allowing for our user-role management and service accesses. As we prepare for 2.0, authentication and session management are being looked at again and your request will be taken into consideration.
I am calling user authentication from a PhoneGap app to a DSP installed on an Ubuntu Server on DigitalOcean. Should there be any reason that the authentication call is so much slower that say a data read call?
No, it’s just another API call so performance should be similar to a data read call. Can you try authenticating outside your PhoneGap app, like with cURL, and see if performance on user auth is similarly slow.
I am using v1.5.9. I tried the curl command and it takes about the same time as the login from the Phonegap app. Login takes around 8-10 seconds while a db query replies in 1-2 seconds. I have only 3 users defined in my app.
That’s unusual. All of those calls should be way faster, including the db query.
This could be something config related. An engineer will need to look at your environment and troubleshoot. Please contact support@dreamfactory.com so we can get a ticket going.
If it’s helpful for comparison as a fellow end-user/developer, I’m getting response times within 400-600ms for a small DigitalOcean virtual server running Apache and Postgres. I agree - something seems off if it’s returning in 8-10 seconds for a simple user session lookup. Hopefully it’s a config setting or similar as you should definitely getting better performance for your mobile app. Sounds like you are queued up for support and will figure this out, would love to hear what it was in the end!