Avatar

Need to Start Web Page with Credentials

0

I am working on an interface to Geotab that opens a Geotab web page in an iframe in a PHP application. 

It would highly desirable to be able to specify the login credentials in the URL, rather than have the user enter the name and password when the page is opened. 

Is there any way to provide credentials in some way other than the standard login form?

Mauricio Muniz

Please sign in to leave a comment.

5 comments

0
Avatar

You can achieve this if you know which page would like direct to. Please refer to post: https://geotab.zendesk.com/entries/23444817-Calling-the-JSON-RPC-methods-from-java to understand how to authenticate a user for the given databasename, username and password. Once you get back LoginResult, you will find SessionId in LoginResult.Credential.SessionId, and database path at LoginResult.Path. Then, you can create a url based on the sessionId, username and databaseName. For Instance, you would like to go to deviceList page, you can construct URL like this: 

https://my22.geotab.com/geotab/checkmate/ui/deviceList.html#credentials:(database:databaseName,sessionId:'234234124235657',userName:'thomasjiang@geotab.com')

Where my22.geotab.com is our server path, and sessionId is what you just got.

Mauricio Muniz 0 votes
0
Avatar

Hi Steve,

That wasn't my problem.  My issue is that I never get the sessionId from the first query.  The document you linked to requires having a session ID to pass in that GET request, but again, I do not have a sessionId from my initial request.

Where do I get the sessionId value?  The URL I provided in my Saturday post (copied below, username and password changed for security) doesn't give me a sessionId in the returned JSON:

https://my6.geotab.com/apiv1/Get?typeName=Device&credentials=%7B%22database%22:%22fleetistics%22,%22userName%22:%22name@example.com%22,%22password%22:%22P4s$W0rd%22%7D

Michael Yingling 0 votes
0
Avatar

Hi Michael,

The session id is obtained by authenticating the user. The documentation has very detailed explanation of how to authenticate and make your first call with the API.

Take a look here

Thanks,

Steve

Steve Hansen 0 votes