Page 1 of 1

Using userToken in a URL

PostPosted: Wed Feb 13, 2019 3:37 pm
by chrisGilbert
Hi,

I have users who may use the same device but I want to ensure that they only use their calendar by forcing it in the initial URL that gets called from Filemaker.

I tried to force this by using the userToken in the URL but it seems that if I have a user without a userToken and send an empty or invalid token in my URL, it just acts like it wasn't in the URL and picks up the last one used in that browser.

How can I force the login screen in this situation ?

Re: Using userToken in a URL

PostPosted: Wed Feb 13, 2019 5:04 pm
by kcembrey
Great question, Chris.

There are a couple options, but either way, you'll need to harden your script in FileMaker to account for a blank userToken.

If a user doesn't log out of DayBack, the browser keeps them logged in. Since both users are logged in on the same computer and user, that means that if no user token is passed to the WebViewer, the last logged in user will be the account that is opened.

You can either prevent the WebViewer from loading if there is no user token set to be passed to the URL, or you can set the userToken parameter in the URL to something random (like "123") and DayBack will log the current user out and load to the login page.

Let me know if that helps!

KC

Re: Using userToken in a URL

PostPosted: Wed Feb 13, 2019 5:13 pm
by chrisGilbert
Thanks.

I did try a random token (like "invalid") but it ignored it and still used the current login. It also seemed to have problems with previously valid tokens which were no longer valid - the page just never appeared. You might want to check out those scenarios.

In any case, I will just prevent the user from moving on if Filemaker can't work out their correct token - not the best option but I'll go with it for now.

Chris.

Re: Using userToken in a URL

PostPosted: Thu Feb 14, 2019 8:47 am
by kcembrey
Hi Chris,

I've verified directly in the browser that entering an invalid user token will log the browser out of DayBack, so I'll have to try this in a WebViewer to see if I get the same results.

Regards,

KC

Re: Using userToken in a URL

PostPosted: Mon Feb 18, 2019 4:43 pm
by kcembrey
Hi Chris,

I verified that passing userToken=123 as a parameter to the URL in a FileMaker WebViewer will log out of DayBack and go to the sign-in screen, so if you're still unable to make it work, send us the URL you're trying to [email protected] and we'll dive into what might be making it not work for in your solution.

Regards,

KC

Re: Using userToken in a URL

PostPosted: Tue Feb 26, 2019 2:51 pm
by chrisGilbert
Hi,

I suspect it's something to do with caching on the browser, and I was testing on the same browser using different user Ids so it was probably pretty confused. I'll let it go for now. Thanks for your time.

Chris.

Re: Using userToken in a URL

PostPosted: Tue Feb 26, 2019 3:57 pm
by ana
Thanks for the update, Chris!

Best wishes,
Ana