Forums

 
ForumForumMainstream Foru...Mainstream Foru...DevelopersDevelopersCall Rest API Login then IsAuthenticated Still Return FalseCall Rest API Login then IsAuthenticated Still Return False
Previous Previous
 
Next Next
New Post
 5/11/2012 5:40 PM
 

Hi Support,

I use Android to call Rest API using IsAuthenticated right after Login method, but still return false. Is there anyway to let it return true?

Login method is returning the correct user ID, but then I called IsAuthenticated method but it returns false.

HTML5 website is running all good in authentication.

Thanks.


Fred

New Post
 5/12/2012 3:17 AM
 
Once the Login method returns, you should get true from IsAuthenticated. My best guess is that you are not waiting for Login to complete before calling IsAuthenticated.

We call IsAuthenticated before just about all calls in our HTML5 Offline Client, so we know it is working properly. Please use the code in the html5 folder as a reference.

You are also encourated to post your code so that we can see what is happening.
New Post
 5/14/2012 10:50 AM
 

I put the two HTTP request here and let's see which property is required, I have underlined the different part:

This is my request from Android:

GET http://192.168.1.169/SplendidCRM/Rest.svc/IsAuthenticated HTTP/1.1
Host: 192.168.1.169
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: ASP.NET_SessionId=1ya5t245vm0wb13ktdjxht55


This is the request from HTML5 Website:
POST http://192.168.1.169/SplendidCRM/Rest.svc/IsAuthenticated HTTP/1.1
Host: 192.168.1.169
Connection: keep-alive
Content-Length: 0
Origin: http://192.168.1.169
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19
content-type: application/json; charset=utf-8
Accept: */*
Referer: http://192.168.1.169/SplendidCRM/html5/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: ASP.NET_SessionId=1ya5t245vm0wb13ktdjxht55

New Post
 5/14/2012 11:15 AM
 

pls forget the HTTP request I pasted here. Sorry. 

Previous Previous
 
Next Next
ForumForumMainstream Foru...Mainstream Foru...DevelopersDevelopersCall Rest API Login then IsAuthenticated Still Return FalseCall Rest API Login then IsAuthenticated Still Return False