cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
15190
Views
20
Helpful
48
Replies

Linking one guest portal to another guest portal

gthermae
Cisco Employee
Cisco Employee

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

2 Accepted Solutions

Accepted Solutions

That is correct behavior. Please check the prescriptive guest guide located under Http://cs.co/ise-guest

Couple key points from the guide
Redirection for https is not recommended and won’t work by default
When you enable captive portal bypass the captive network assistant won’t auto launch

View solution in original post

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.

View solution in original post

48 Replies 48

Charlie Moreton
Cisco Employee
Cisco Employee

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.

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.

Great Idea!  Now we just need someone to give the code to turn the links into buttons and we're all set!

HotspotMenu2.PNG

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.

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)

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>

Simple enough!

HotspotMenu3.PNG

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

Saw that, so you’re saying Captive Network Assistant is disabled so the apple mini browser is working fine?

Correct. I've got this working in a 2.3 lab and also live with a customer on 2.2.

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

Thanks for pointing this out.  Yes, absolutely that is correct.  I'll update the document to reflect that.  Appreciate the feedback.

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.

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

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 URLISE-Link-portal.jpg