PWB CEF Autologin to a Site
-
- Observer
- Posts: 6
- Joined: Tue Sep 15, 2020 1:50 pm
PWB CEF Autologin to a Site
Hello,
I've been asked to configure our public kiosks to automatically log in to our portal site with a special elevated public user account, but we also need to clear browser cookies after each session. We also can't expose the password to the public.
I'm looking at ways I might accomplish this, such as AutoHotkey. Does anyone have any suggestions?
I've been asked to configure our public kiosks to automatically log in to our portal site with a special elevated public user account, but we also need to clear browser cookies after each session. We also can't expose the password to the public.
I'm looking at ways I might accomplish this, such as AutoHotkey. Does anyone have any suggestions?
Re: PWB CEF Autologin to a Site
Is it just a normal login with an HTML post form a form?
What is the URL of the page?
--Scott
What is the URL of the page?
--Scott
-
- Observer
- Posts: 6
- Joined: Tue Sep 15, 2020 1:50 pm
Re: PWB CEF Autologin to a Site
We can add an after page load URL filter that can run a JavaScript from a text file.
Text File:
document.getElementById('username').value='nameTest';
document.getElementById('password').value='passwordTest';
document.forms[0].submit();
Once the page is loaded, if the URL filter matched the URL the above JavaScript from file is executed on the page and fills in the user name and password and submits the form.
--Scott
Text File:
document.getElementById('username').value='nameTest';
document.getElementById('password').value='passwordTest';
document.forms[0].submit();
Once the page is loaded, if the URL filter matched the URL the above JavaScript from file is executed on the page and fills in the user name and password and submits the form.
--Scott
-
- Observer
- Posts: 6
- Joined: Tue Sep 15, 2020 1:50 pm
Re: PWB CEF Autologin to a Site
Thanks Scott,
Where in the ini file is the after page load URL filter defined? I'm assuming there's a key for the filter file with the URL(s) and another for the javascript file that should run, similar to how I've set up the access filter?
Where in the ini file is the after page load URL filter defined? I'm assuming there's a key for the filter file with the URL(s) and another for the javascript file that should run, similar to how I've set up the access filter?
Re: PWB CEF Autologin to a Site
It is not in the INI file yet. I was proposing we could program the functionary into PWB.
If you think it will work, it will take a few days to program it into PWB 3.05.9.
--Scott
If you think it will work, it will take a few days to program it into PWB 3.05.9.
--Scott
-
- Observer
- Posts: 6
- Joined: Tue Sep 15, 2020 1:50 pm
Re: PWB CEF Autologin to a Site
Oh, I'd misunderstood... That's awesome!
Yes, I think that'd be exactly what we'd need and a lot better than the hacky solutions I've been working on. It'd be greatly appreciated if you could!
Yes, I think that'd be exactly what we'd need and a lot better than the hacky solutions I've been working on. It'd be greatly appreciated if you could!
Re: PWB CEF Autologin to a Site
The proposed functionality seemed good to have so we are already working on it. Hopefully we will have it incorporated by early next week.
--Scott
--Scott
Re: PWB CEF Autologin to a Site
PWB 3.05.9 CEF Release Candidate 1 is now available on the Beta Downloads page.
This version contains the following functionality. The following need to be added/modified in the INI file.
[Secuity]CheckJavaScriptAccess=False
[Files]JavaScriptFilterFile=
Enabling the filter for JavaScript access will have PWB read the JavaScript filter file. The JavaScript filter works similar to the URL filter with the added functionality of running a JavaScript from a different file.
The filter file is a tab separated +/-URL and JavaScript file.
For example:
If the filter matches PWB will run the JavaScript found in "signin.txt" on the page.
Careful if the JavaScript causes the page to be reloaded it could cause an infinite loop.
--Scott
This version contains the following functionality. The following need to be added/modified in the INI file.
[Secuity]CheckJavaScriptAccess=False
[Files]JavaScriptFilterFile=
Enabling the filter for JavaScript access will have PWB read the JavaScript filter file. The JavaScript filter works similar to the URL filter with the added functionality of running a JavaScript from a different file.
The filter file is a tab separated +/-URL and JavaScript file.
For example:
Code: Select all
-all
+https://odysseyidentityprovider.tylerhost.net/idp/account/signin?ReturnUrl= signin.txt
Careful if the JavaScript causes the page to be reloaded it could cause an infinite loop.
--Scott
Re: PWB CEF Autologin to a Site
See attached files for an example.
[Files]
JavaScriptFilterFile=signinfilter.txt
[Security]
CheckJavaScriptAccess=True
--Scott
[Files]
JavaScriptFilterFile=signinfilter.txt
[Security]
CheckJavaScriptAccess=True
--Scott
- Attachments
-
- signinjavascript.txt
- (166 Bytes) Downloaded 1730 times
-
- signinfilter.txt
- (67 Bytes) Downloaded 1779 times
-
- Observer
- Posts: 6
- Joined: Tue Sep 15, 2020 1:50 pm
Re: PWB CEF Autologin to a Site
Thanks Scott!
I had time to do some quick testing, and it doesn't seem to be firing after updating my ini and pointing it at those files. The javascript works perfectly though if I send it through the dev console in Chrome. I also created a filter for this forum and a javascript text file to attempt login as me, and I can't seem to get the javascript to trigger there either.
Is there any way to debug that? It's entirely possible I missed or typo'd something that I'll see when I pick this back up on Monday.
I had time to do some quick testing, and it doesn't seem to be firing after updating my ini and pointing it at those files. The javascript works perfectly though if I send it through the dev console in Chrome. I also created a filter for this forum and a javascript text file to attempt login as me, and I can't seem to get the javascript to trigger there either.
Is there any way to debug that? It's entirely possible I missed or typo'd something that I'll see when I pick this back up on Monday.
Re: PWB CEF Autologin to a Site
Are you using version 3.05.9 from the Beta Downloads page?
To see if the filter is finding the URL use the History file.
[Security]
WriteHistoryFile=True
LogAccess=True
History file tokens:
https://www.teamsoftwaresolutions.com/f ... ?f=4&t=195
--Scott
To see if the filter is finding the URL use the History file.
[Security]
WriteHistoryFile=True
LogAccess=True
History file tokens:
https://www.teamsoftwaresolutions.com/f ... ?f=4&t=195
--Scott
-
- Observer
- Posts: 6
- Joined: Tue Sep 15, 2020 1:50 pm
Re: PWB CEF Autologin to a Site
It was a typo! Had the wrong case on an element id.
Works great, this is just what we needed. Thank you!
Works great, this is just what we needed. Thank you!
Re: PWB CEF Autologin to a Site
PWB 3.05.9 should be released this week. We are just waiting on one more sign off.
--Scott
--Scott