FortiNAC
NOTE: FortiNAC is now named FortiNAC-F. For post-9.4 articles, see FortiNAC-F. FortiNAC is a zero-trust network access solution that provides users with enhanced visibility into the Internet of Things (IoT) devices on their enterprise networks.
FortiKoala
Staff
Staff
Article Id 196711
Description
Ensure users in the production network access the FortiNAC portal pages using a secure URL (HTTPS).

The below solution is designed to redirect hosts on the production network to a HTTPS URL when attempting to manually browse for FortiNAC portal pages using HTTP.  A common use case would be attempting to reach the Gaming Device Registration or Host Inventory pages from a registered device on the production network.

Note: While in a FortiNAC isolated VLAN, if a SSL Certificate is installed on the captive portal, hosts will automatically be redirected to the HTTPS URL. However, the end user can modify the URL to HTTP and access the pages in that manner should they wish. This redirect will automatically change the URL back to HTTPS.


Solution

This JavaScript checks to see if the currently loaded page is using HTTPS.  If not, it will rewrite the URL to HTTPS instead of HTTP.

1.  In the Administration UI, navigate to System > Portal Configuration.
2.  Place the below contents in the left column content section of each captive portal page requiring redirection: 

<script language="javascript">
if (window.location.protocol != "https:")
window.location.href = "https:" + window.location.href.substring(window.location.protocol.length);
</script>


Contributors