03-03-2017 01:04 AM
Hi,
We just spent some time to build a link from a hotspot portal to a guestportal. Just thought I would share the code we inserted in the opt content 2 on the hotspot page. The trick is to take the sessionId from the current url on the hotspot page and add it to the link. Also want to give creds to Christophe Landrain who did most of this.
$(window).ready(function() {
var hostname = window.location.hostname;
var WebSessionId = window.location.href.substr(window.location.href.search("\\?")).split("=")[2];
jQuery('.cisco-ise-body').append(' <center><a href="https://'+hostname+':8449/portal/gateway?sessionId='+WebSessionId+'&portal=a23657f0-d7e2-11e6-a31c-0050568a29f5&action=cwa" style="color: rgb(0,255,0)"><font color="212121">Go to Guest Portal</font></a></center>');
});
//Gunnar
Solved! Go to Solution.
04-24-2019 03:41 PM
10-26-2020 09:27 AM - edited 10-26-2020 09:28 AM
Today I received a working script from Cisco Engineer which needs to be configured under optional content 1 of the hotspot link portal(see attached picture) and script attached. It is tested and working well.
03-03-2017 05:36 AM
Great job!
I just tested this script and it works. Remember to open with <script> and close with </script> or the var calls will not work.
I am using ISE 2.2 and had to place the WebSessionID after the PortalID. (I am also using a different port for my Guest Portal).
<script>
jQuery(window).ready(function() {
var hostname = window.location.hostname;
var WebSessionId = window.location.href.substr(window.location.href.search("\\?")).split("=")[2];
jQuery('.cisco-ise-body').append(' <center><a href="https://'+hostname+':8443/portal/PortalSetup.action?portal=3c379d60-fceb-11e5-b628-005056a49fb9&sessionId='+WebSessionId+'&action=cwa" style="color: rgb(0,255,0)"><font color="212121">Go to Guest Portal</font></a></center>');
});
</script>
Thanks again for putting in the time to get this done.
03-03-2017 05:56 AM
Guys great stuff! I love the community, thanks for your help!
I have had this asked recently from a customer who wanted to have 2 separate portals (depending on who was self-registering). Example Portal1 for Conference1 and Portal2 for Conference2. This allowed them to know who was attending by having a passcode different for each portal as well.
03-03-2017 06:13 AM
Great Idea! Now we just need someone to give the code to turn the links into buttons and we're all set!
If we start with the script for "Hotspot as a Message Portal" we can use it as a menu for the end users to choose the portal through which they can log on. 'Student' can be a Sponsored Guest Portal with AD Credentials, 'Athletic Event' can be a traditional Hotspot, 'Conference' can be Self-Registered Guest, etc...
This is HUGE with potential and possibilities.
03-03-2017 06:17 AM
Yes, even better in 2.2 we could use a simple HTML page redirect as well (have to capture the session ID on that page though, not sure if possible)
03-03-2017 07:30 AM
The simple way to make them into buttons is just to add the html needed.
<button type="submit">Go to Guest Portal</button>
Complete script would be:
<script>
jQuery(window).ready(function() {
var hostname = window.location.hostname;
var WebSessionId = window.location.href.substr(window.location.href.search("\\?")).split("=")[2];
jQuery('.cisco-ise-body').append(' <center><a href="https://'+hostname+':8443/portal/PortalSetup.action?portal=3c379d60-fceb-11e5-b628-005056a49fb9&sessionId='+WebSessionId+'&action=cwa" style="color: rgb(0,255,0)"><font color="212121"><button type="submit">Go to Guest Portal</button></font></a></center>');
});
</script>
03-03-2017 08:05 AM
Simple enough!
05-15-2018 02:19 PM
I worked this out and documented it. No issues w/ CWA (WLAN CNA Bypass = disabled). I hope this helps someone out. If there are any errors or holes in it, I'd appreciate the feedback and will update accordingly. Big thanks to Charles and Gunnar on this thread for supplying the code!
Anthony
05-15-2018 02:22 PM
Saw that, so you’re saying Captive Network Assistant is disabled so the apple mini browser is working fine?
05-15-2018 02:25 PM
Correct. I've got this working in a 2.3 lab and also live with a customer on 2.2.
05-15-2018 02:26 PM
NICE! Also keep in mind the way you’re doing it is statically assigning the referral links. If you only have 1 PSN servicing the guest then this isn’t a problem but should use dynamic code instead as listed
https://communities.cisco.com/message/248127#248127
05-15-2018 02:31 PM
Thanks for pointing this out. Yes, absolutely that is correct. I'll update the document to reflect that. Appreciate the feedback.
05-31-2018 02:42 AM
I did some additional testing also with your document in mind. It seems like the more static the script is, chances are better for Apple CNA to work. This is still a major issue for us since we need the additional flexibility from scripting and we can't use static code always. But not being compatible with Apple devices is not an option and enabling Captive Bypass on the WLC makes the user experience less intuitive.
Thank you for sharing your experiences, it helps to better understand what are the dos and don'ts (and limitations) of using JavaScript for portal customization in conjunction with Apple CNA.
05-31-2018 04:14 AM
Sorry we have no control over the Apple browser and its limitations , it’s hard to debug as well if near impossible
Would recommend you enable captive bypass and/or request the feature in the product as well they sales channel
10-10-2020 05:28 AM - edited 10-10-2020 05:31 AM
Charlie I have used the above scripts but I am not getting button's like yours. Have you done any additional lines for buttons to display like yours. I see in the preview and also in portal test URL
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide