Community discussions

MikroTik App
 
User avatar
mktwifi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Wed Oct 15, 2008 9:45 am

Apple CNA doesn't show up

Fri Aug 19, 2022 1:15 pm

Hi All,
we encountered a strange issue that is causing headaches to our clients.
We configure the hotspot radius service within a Custom HTML directory and at the first iOs SSID join, a device shows the customised CNA. That's great, but now the problem.
Once a user comes back again and rejoins the same SSID, no CNA is popped up.
Android seems to work every time.

We have done several tests, even trying what apple calls "Modern Captive portal" https://developer.apple.com/news/?id=q78sq5rv introducing the DHCP Option 114 but without luck.
We tried to remove HTTPS redirect and use HTTP, no fix.
We tried to use local users (no radius), but no fix.

The only way to popup the CNA every time a user needs to join the hotspot is to remove the custom HTML, and this seems to work.
Is it possible to Fix this even on a customized HTML directory? It seems a clear bug to us.
Thank you all.


PS
I forgot to mention that we tried ROS 6.48.6 Long-term and 6.49.6 Stable
 
User avatar
mktwifi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Wed Oct 15, 2008 9:45 am

Re: Apple CNA doesn't show up

Mon Aug 29, 2022 5:21 pm

Just a quick update, we found that the main cause of this was due to the old HTML template used.
We reset the HTML inside the Mikrotik and with the basic one it works.
We are working to "migrate" our template with the new schema.
Enjoy.
 
User avatar
mktwifi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Wed Oct 15, 2008 9:45 am

Re: Apple CNA doesn't show up

Thu Sep 01, 2022 10:11 am

Just a quick update for you guys.
Randomly Apple disables this option, If this is turned off, CNA will not appear at all:
20220830-110745_090122_091249_AM.jpg
You do not have the required permissions to view the files attached to this post.
 
User avatar
mktwifi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Wed Oct 15, 2008 9:45 am

Re: Apple CNA doesn't show up

Fri Dec 02, 2022 9:52 am

We finally found the cause of all headaches.
There is a file called api.json inside the new standard hotspot folder, that triggers the Apple Cna.
With it, it pops up.
Without it doesn't.
Please document this in the guides guys, otherwise, engineers like us will get sick.
 
User avatar
pablorib
just joined
Posts: 14
Joined: Mon Oct 07, 2013 3:32 am
Location: Santa cruz Bolivia
Contact:

Re: Apple CNA doesn't show up

Tue Jan 17, 2023 5:57 pm

THANK YOU... IT HELPED ME SOLVE MY PROBLEM
Last edited by BartoszP on Tue Jan 17, 2023 6:04 pm, edited 1 time in total.
Reason: removed excessive quotting of preceding post; be wise, quote smart, save network traffic
 
User avatar
sszbv
Trainer
Trainer
Posts: 10
Joined: Sun Oct 07, 2012 11:47 am
Contact:

Re: Apple CNA doesn't show up

Mon Feb 20, 2023 10:22 am

I can confirm that this is the solution for the latest Apple device login problems.
Just add the api.json (in my case from ros 7.6) to the root of your (custom) hotspot folder.
 
airbytes
just joined
Posts: 4
Joined: Tue Jul 21, 2020 1:56 am
Location: Earth

Re: Apple CNA doesn't show up

Mon Mar 13, 2023 4:55 pm

We finally found the cause of all headaches.
There is a file called api.json inside the new standard hotspot folder, that triggers the Apple Cna.
With it, it pops up.
Without it doesn't.
Please document this in the guides guys, otherwise, engineers like us will get sick.
Hi mktwifi,

did you modified something into api.json? or did you add a Option 114 to call this file?
 
fmoreno
just joined
Posts: 1
Joined: Wed Mar 15, 2023 10:15 am

Re: Apple CNA doesn't show up

Wed Mar 15, 2023 10:29 am

I have configured the hotspot on the mikrotik with the api.json file.
The mikrotik sends in the DHCP process, the url https://"dns name"/api.
But I don't see the device (iphone) make an API query to the mikrotik.

In no way can I get the captive portal to jump on some Iphones.

JSON file:

{
"captive": $(if logged-in == 'yes')false$(else)true$(endif),
"user-portal-url": "https://paginaprueba.com"
}

Can you help me please?
 
amobasher
newbie
Posts: 31
Joined: Sun Jul 06, 2014 3:19 pm

Re: Apple CNA doesn't show up

Thu Mar 23, 2023 11:01 am

I can confirm that this is the solution for the latest Apple device login problems.
Just add the api.json (in my case from ros 7.6) to the root of your (custom) hotspot folder.
It doesn't work for me, i've reset the hotspot html, then copied the API.Json file to my customized hotspot folder, then copied the customized folder to my routerboard but still apple devices don't popup the captive portal ?
 
Flo
just joined
Posts: 3
Joined: Fri Mar 31, 2023 8:36 am

Re: Apple CNA doesn't show up

Fri Mar 31, 2023 8:57 am

Mybee interessting fact i found out with the case that the Portal is not working....
I found following Info on the Apple Side:

DHCP Option: 114 (Captive-Portal)
Length: 38
Value: https://example.org/captive-portal/api

DHCPv6 Option: 103 (Captive-Portal)
Length: 38
Value: https://example.org/captive-portal/api

IPv6 RA Option: 37 (Captive-Portal)
Length: 38
Value: https://example.org/captive-portal/api


So i created follwoing DHCP Option for my Hotspot DHCP Server:
/ip dhcp-server option
add code=114 force=yes name="Captive Portal" value="'http://***IP Hotspot Bridge***'"
add code=160 force=yes name=option1 value="'http://***IP Hotspot Bridge***'"
/ip dhcp-server option sets
add name=set1 options="Captive Portal,option1"
Than i had to go to the DHCP Server and activate the DHCP Option.

After this i greated an Walled Garden deny rule.
(iOS is checking captive.apple if there is internet on the connected WLAN)
add action=deny dst-host=*captive.apple* server=****HOTSPOT-SERVER-NAME****
Than move this rule to 1st positon.
Since than my Hotspot Portal is back working on all iOS devices.

Maybe it will help some others.

Info from Apple regarding DHCP Options: https://developer.apple.com/news/?id=q78sq5rv

Who is online

Users browsing this forum: Majestic-12 [Bot], nuwang13, Rhydu and 60 guests