Vai al contenuto principale

Integrazione dell'autenticazione WiFi WeChat: onboarding tramite Captive Portal per i clienti APAC

WeChat conta 1,41 miliardi di utenti attivi mensili, il che lo rende l'identità digitale principale per i consumatori cinesi a livello globale. Questa guida spiega come integrare l'autenticazione WeChat OAuth 2.0 nei Captive Portal aziendali per le sedi APAC, coprendo la registrazione della piattaforma, la selezione dello scope, l'applicazione del RADIUS Change of Authorisation e la conformità al doppio framework con il GDPR e la PIPL cinese. Si rivolge a IT manager, network architect e direttori delle operazioni delle sedi che devono agire in questo trimestre.

📖 9 minuti di lettura📝 2,130 parole🔧 2 esempi pratici4 domande di esercitazione📚 10 definizioni chiave

Ascolta questa guida

Visualizza trascrizione del podcast
HOW TO CONFIGURE WECHAT OAUTH AUTHENTICATION FOR CAPTIVE PORTALS A Purple Technical Briefing - Approximately 10 Minutes INTRODUCTION AND CONTEXT (approximately 1 minute) Welcome. If you are responsible for guest WiFi at a hotel, retail chain, stadium, or conference centre that serves Chinese visitors, this briefing is for you. WeChat has 1.41 billion monthly active users as of 2025, according to Tencent's own data. The overwhelming majority are in China, but the platform has a meaningful international footprint too. Malaysia has 12 million WeChat users. Japan has 5.5 million. South Korea, 5 million. And the numbers are growing across Southeast Asia, the Middle East, and Europe. When a Chinese guest connects to your WiFi and sees a login page with only email, Facebook, or a voucher code, they face immediate friction. They may not have a local email address set up on that device. They almost certainly have WeChat. So the question is not whether you should offer WeChat login. It is how you configure it correctly, securely, and in a way that generates first-party data you can actually use. That is what we are going to cover today. We will walk through the OAuth 2.0 flow, the two platform registrations you need, the scope decision that determines what data you collect, the network-side enforcement mechanism, and the compliance considerations that matter in 2026. TECHNICAL DEEP-DIVE (approximately 5 minutes) Let us start with the architecture. A captive portal intercepts HTTP traffic from an unauthenticated device and redirects it to a login page. That login page is hosted on a portal server, either on-premises or in the cloud. When you add WeChat OAuth, you are inserting a third-party identity provider into that flow. Here is the sequence. The guest connects to your SSID. The access point or wireless controller detects that the device has no authenticated session and redirects all HTTP traffic to your captive portal URL. The portal page loads and presents login options, including WeChat. The guest taps WeChat login. Your portal server redirects the browser to WeChat's authorisation endpoint, passing your AppID, the redirect URI, the response type of code, and the scope. WeChat handles the authentication entirely on its own servers. If the guest is already logged into WeChat in their browser, they see a consent screen. If they are using the WeChat in-app browser, the experience can be silent with the snsapi base scope, meaning no consent prompt at all. WeChat then redirects back to your portal's redirect URI with a temporary authorisation code. Your portal server exchanges that code for an access token by calling the WeChat API. WeChat returns an access token, a refresh token, the user's OpenID, and the scope granted. If you requested the snsapi userinfo scope, you can then make a second API call to retrieve the user's nickname, avatar, gender, and city. Now, the two platform registrations. This is where most implementations go wrong. WeChat has two separate developer platforms. The WeChat Open Platform handles website applications and mobile apps. The WeChat Official Accounts Platform handles public accounts, which is what most venues actually need. For a captive portal serving guests inside the WeChat in-app browser, you need a Service Account on the Official Accounts Platform. A Subscription Account will not work. It does not have OAuth web page authorisation permissions. A Service Account does, and it supports both the snsapi base and snsapi userinfo scopes. For a captive portal accessed from a standard mobile browser outside WeChat, such as Chrome on Android or Safari on iOS, you need a Website Application registered on the Open Platform. This uses the snsapi login scope and presents a QR code that the user scans with their WeChat app. In practice, most venue deployments use both. A guest at a hotel might open the portal in Chrome, see a QR code, scan it with WeChat, and authenticate. Or they might follow a link in WeChat itself, land in the in-app browser, and authenticate silently with snsapi base. Let us talk about scope selection, because this is a genuine decision point. The snsapi base scope returns only the OpenID. This is a unique identifier for that user within your Official Account. It requires no user consent prompt. The authentication is invisible to the user. This is ideal for returning guests you have already profiled, or for venues where you want zero friction at the cost of zero new data. The snsapi userinfo scope returns the OpenID plus the user's WeChat nickname, profile picture, gender, language setting, and city. It requires an explicit consent screen. The user sees a prompt asking whether they allow your Official Account to access their information. Most users accept, but there is friction. The right choice depends on your use case. For a first-time guest registration where you want to build a profile, use snsapi userinfo and pair it with a GDPR-compliant consent layer on your portal page. For a returning guest who has already consented and whose profile you already hold, use snsapi base for silent re-authentication. Now, the network enforcement side. Getting an OAuth token proves identity, but it does not automatically open the network. You need a mechanism to translate a successful authentication into network access. The two standard approaches are RADIUS Change of Authorisation, defined in RFC 3576, and MAC address bypass. With RADIUS CoA, your portal server sends a CoA request to the network controller after successful OAuth, and the controller moves the device from the unauthenticated VLAN to the guest VLAN. This works with Cisco Meraki, HPE Aruba, Ruckus, Juniper Mist, Ubiquiti UniFi, Cambium, Extreme, and Fortinet. With MAC bypass, the portal server registers the device's MAC address as an authorised client, and the controller allows it. MAC bypass is simpler to implement but less secure, because MAC addresses can be spoofed, and modern smartphones increasingly use MAC address randomisation, which breaks the mechanism on reconnection. Purple's Guest WiFi platform handles both mechanisms. After WeChat OAuth completes, Purple's cloud overlay sends the appropriate signal to the underlying hardware. The venue operator does not need to manage that translation manually. IMPLEMENTATION RECOMMENDATIONS AND PITFALLS (approximately 2 minutes) Let me give you the five things that cause WeChat OAuth captive portal implementations to fail. First: the redirect URI mismatch. WeChat validates the redirect URI against the authorised domain you registered on the platform. If your portal server uses a different subdomain, a different path, or HTTP instead of HTTPS, the OAuth flow fails with error 40029, which means invalid code. Register every domain variant you use, including staging environments. Second: the AppSecret on the client side. Your AppSecret must never appear in client-side JavaScript or in a mobile app binary. It belongs on your server. If it is exposed, anyone can impersonate your application and call WeChat's APIs on your behalf. Third: missing CSRF protection. The state parameter in the OAuth request exists specifically to prevent cross-site request forgery. Generate a cryptographically random state value, store it in the user's session, and validate it when WeChat redirects back. Skip this and you have a real vulnerability. Fourth: the in-app browser detection gap. WeChat's in-app browser sets a specific user agent string containing MicroMessenger. If your portal does not detect this and serve the correct OAuth flow, users get a broken experience or an error. Fifth: GDPR and PIPL alignment. If you serve European visitors, GDPR applies to the data you collect via WeChat OAuth. If you serve Chinese visitors, China's Personal Information Protection Law, known as PIPL, applies to how you process their data. Both require a lawful basis for processing, clear purpose limitation, and data minimisation. The snsapi base scope is easier to justify under data minimisation principles than snsapi userinfo. Whatever you collect, document your legal basis and your retention period. RAPID-FIRE Q AND A (approximately 1 minute) Question: Can I use WeChat login on a portal that also offers email and SMS login? Yes. Most enterprise portal platforms, including Purple, support multiple authentication methods on the same portal page. WeChat appears as one option alongside others. Question: Does WeChat OAuth work on iOS? Yes, but with a nuance. Apple's App Tracking Transparency framework does not affect server-side OAuth flows. WeChat login in Safari on iOS works via the QR code flow or redirect flow. The WeChat app itself handles the authentication. Question: What happens if WeChat's API is unavailable? Your portal should implement a fallback. If the WeChat API call times out or returns an error, redirect the user to an alternative login method. Do not leave them with a blank screen. Question: Can I use the OpenID as a persistent customer identifier? Within your Official Account, yes. The OpenID is stable for a given user and a given Official Account. If you have multiple Official Accounts, the same user will have different OpenIDs across them. For cross-account identity resolution, WeChat provides a UnionID, which requires your accounts to be linked on the Open Platform. SUMMARY AND NEXT STEPS (approximately 1 minute) To summarise. WeChat OAuth authentication for captive portals is a two-platform registration exercise, a scope decision, a network enforcement integration, and a compliance review. Get those four things right and you have a login method that serves over a billion potential visitors with zero password friction. The practical next steps are these. First, determine whether your visitors encounter the portal inside the WeChat in-app browser or in a standard mobile browser. That determines which platform registration you need. Second, decide on scope. Use snsapi base for returning guests, and snsapi userinfo for first-time registration with consent. Third, confirm your network hardware supports RADIUS CoA or configure MAC bypass as an alternative. Fourth, review your privacy notice and consent flow against GDPR and PIPL requirements. Fifth, test the redirect URI, the state parameter validation, and the in-app browser detection before you go live. If you want to see how Purple handles WeChat OAuth as part of a broader Guest WiFi and analytics platform, across 80,000 venues and 440 million logins in 2024, visit purple.ai or speak to your account team. Thanks for listening.

header_image.png

Sintesi esecutiva

Per le sedi aziendali che operano nella regione APAC o che servono turisti cinesi a livello globale, l'autenticazione WiFi WeChat non è più opzionale. Con 1,41 miliardi di utenti attivi mensili al 2025 (fonte: Tencent), WeChat è l'identità digitale principale per i consumatori cinesi. Un ospite che si connette al tuo SSID e vede solo le opzioni di accesso tramite e-mail o Facebook si scontra con un ostacolo immediato. Quasi sicuramente ha WeChat. Quasi sicuramente non ha un indirizzo e-mail locale configurato su quel dispositivo.

Questa guida spiega in dettaglio come integrare WeChat OAuth 2.0 in un Captive Portal. Copriamo le due distinte registrazioni della piattaforma richieste da Tencent, la decisione sullo scope che determina quali dati di prima parte raccogliere e il meccanismo RADIUS Change of Authorisation (CoA) che traduce uno scambio OAuth andato a buon fine in un accesso effettivo alla rete. Affrontiamo anche i requisiti di conformità sovrapposti del GDPR e della legge cinese sulla protezione delle informazioni personali (PIPL).

La piattaforma Guest WiFi di Purple automatizza il livello di applicazione della rete su hardware Cisco Meraki, HPE Aruba, Ruckus, Juniper Mist, Ubiquiti UniFi, Cambium, Extreme e Fortinet. Purple opera in oltre 80.000 sedi attive e ha registrato 440 milioni di accessi nel 2024 (dati interni Purple).

Approfondimento tecnico

Il flusso OAuth 2.0

Un Captive Portal (un gateway di autenticazione basato sul web che intercetta il traffico HTTP dai dispositivi non autenticati) reindirizza gli ospiti a una pagina di accesso ospitata su un server del portale, on-premise o nel cloud. L'aggiunta di WeChat OAuth inserisce l'infrastruttura di identità di Tencent in questo flusso.

La sequenza si svolge come segue. L'ospite si associa all'SSID. Il controller wireless rileva l'assenza di una sessione autenticata e reindirizza tutto il traffico HTTP all'URL del Captive Portal. La pagina del portale si carica e presenta le opzioni di accesso, tra cui WeChat. L'ospite seleziona WeChat. Il server del portale crea un reindirizzamento all'endpoint di autorizzazione di WeChat all'indirizzo open.weixin.qq.com, passando quattro parametri: l'AppID, l'URI di reindirizzamento, il tipo di risposta impostato su code e lo scope richiesto.

WeChat autentica l'utente interamente sulla propria infrastruttura. Se l'ospite ha già effettuato l'accesso tramite il browser in-app di WeChat, lo scope snsapi_base consente l'autenticazione invisibile senza alcuna richiesta visibile. WeChat reindirizza all'URI di reindirizzamento registrato del portale con un codice di autorizzazione a breve scadenza. Il server del portale scambia questo codice con un token di accesso chiamando api.weixin.qq.com/sns/oauth2/access_token con AppID, AppSecret, codice e tipo di concessione. WeChat restituisce un token di accesso, un token di aggiornamento, l'OpenID dell'utente e lo scope concesso. Se è stato richiesto snsapi_userinfo, una seconda chiamata API a api.weixin.qq.com/sns/userinfo recupera il nickname dell'utente, l'immagine del profilo, il genere e la città.

architecture_overview.png

Registrazione della piattaforma: la decisione che ostacola la maggior parte delle implementazioni

Tencent gestisce due piattaforme di sviluppo separate e la selezione di quella errata è la causa più comune di fallimento delle implementazioni.

Contesto di accesso Registrazione richiesta URL della piattaforma Scope supportati
Browser in-app WeChat Account di servizio (Official Accounts Platform) mp.weixin.qq.com snsapi_base, snsapi_userinfo
Browser mobile standard (Chrome, Safari) Applicazione sito web (Open Platform) open.weixin.qq.com snsapi_login (flusso codice QR)

Un account di abbonamento sulla Official Accounts Platform non funzionerà. Manca delle autorizzazioni di autorizzazione della pagina web OAuth. Solo un account di servizio dispone di tali autorizzazioni.

La maggior parte delle implementazioni aziendali nei settori Hospitality and Retail implementa entrambe le registrazioni. Un ospite in un hotel potrebbe aprire il portale in Chrome, scansionare un codice QR con WeChat e autenticarsi tramite il flusso della Open Platform. Oppure potrebbe seguire un link all'interno di WeChat stesso, atterrare nel browser in-app e autenticarsi in modo invisibile tramite il flusso degli Official Accounts. Entrambi i percorsi devono essere gestiti.

Selezione dello scope e raccolta dei dati

Lo scope OAuth è una vera e propria decisione architetturale, non un dettaglio di configurazione. Determina l'attrito riscontrato dall'utente e i dati ricevuti dalla tua piattaforma di WiFi Analytics .

snsapi_base restituisce solo l'OpenID, un identificatore univoco e stabile per quell'utente all'interno del tuo account ufficiale. Non richiede alcuna richiesta di consenso da parte dell'utente. L'autenticazione è invisibile. Utilizzalo per gli ospiti di ritorno di cui possiedi già i profili o per ambienti ad alta densità come stadi e hub di trasporto in cui la velocità di connessione è la priorità.

snsapi_userinfo restituisce l'OpenID più il nickname, l'immagine del profilo, il genere, l'impostazione della lingua e la città. Attiva una schermata di consenso esplicito. Utilizzalo per la registrazione degli ospiti al primo accesso per creare un profilo di dati di prima parte, abbinato a un livello di consenso conforme a PIPL e GDPR sulla pagina del portale.

La regola pratica: usa snsapi_base per la velocità, snsapi_userinfo per i dati. Puoi implementare entrambi verificando se l'OpenID dell'utente esiste già nel tuo database. In caso affermativo, richiedi snsapi_base. In caso contrario, richiedi snsapi_userinfo.

Applicazione della rete: RADIUS CoA e MAC bypass

Un token OAuth dimostra l'identity. Non apre la rete. Un meccanismo separato deve tradurre l'avvenuta autenticazione in una modifica della policy di rete.

RADIUS Change of Authorisation (CoA), definito in RFC 3576, è l'approccio standard. Dopo che il server del portale riceve un token OAuth valido, invia una richiesta CoA al controller wireless. Il controller aggiorna la sessione, spostando il dispositivo dalla VLAN walled garden (un segmento di rete limitato che consente solo il traffico del portale) alla VLAN guest completa. Questo funziona con Cisco Meraki, HPE Aruba, Ruckus, Juniper Mist, Ubiquiti UniFi, Cambium, Extreme e Fortinet.

Il MAC address bypass registra l'indirizzo MAC del dispositivo come client autorizzato dopo un OAuth andato a buon fine. Il controller consente quindi il traffico da quell'indirizzo senza ulteriori verifiche. È più semplice da implementare ma comporta due rischi: gli indirizzi MAC possono essere contraffatti (spoofed), e da iOS 14 e Android 10 in poi viene utilizzata la randomizzazione dell'indirizzo MAC per impostazione predefinita, il che interrompe il meccanismo alla riconnessione.

Per qualsiasi implementazione in cui la sicurezza è fondamentale, RADIUS CoA è la scelta corretta. Per saperne di più sulla sicurezza delle reti guest, consulta Cos'è il WiFi sicuro: Guida essenziale per le aziende 2026 e Sicurezza WiFi aziendale: Una guida completa per il 2026 .

Guida all'implementazione

Checklist pre-installazione

Prima di scrivere una sola riga di configurazione, completa questi cinque passaggi.

In primo luogo, determina il contesto di accesso. Analizza la tua struttura e identifica se gli ospiti visualizzeranno il portale all'interno del browser in-app di WeChat, in un browser mobile standard o in entrambi. La risposta determina i requisiti di registrazione sulla piattaforma.

In secondo luogo, registrati sulla piattaforma corretta. Per l'accesso tramite browser in-app, crea un Service Account sulla WeChat Official Accounts Platform. Per l'accesso tramite browser standard, registra una Website Application sulla WeChat Open Platform. Prendi nota di AppID e AppSecret per ciascuna.

In terzo luogo, configura i tuoi URI di reindirizzamento. Registra ogni dominio e sottodominio utilizzato dal tuo portale, inclusi gli ambienti di staging. WeChat impone la convalida a corrispondenza esatta. Una mancata corrispondenza restituisce l'errore 40029.

In quarto luogo, implementa lo scambio di token lato server. L'AppSecret non deve mai apparire nel codice lato client. Crea un endpoint lato server che accetti il codice di autorizzazione, lo scambi con un token e restituisca solo i dati necessari al tuo portale.

In quinto luogo, implementa il parametro state per la protezione CSRF. Genera un valore crittograficamente casuale, salvalo nella sessione dell'utente, passalo nella richiesta OAuth e convalidalo al ritorno.

Passaggi di configurazione per Ruckus SmartZone

Per le strutture che utilizzano Ruckus SmartZone, la configurazione del portale WeChat si trova sotto Services and Profiles, poi Hotspots and Portals, e infine nella scheda WeChat. Configura l'Authentication URL (l'endpoint di callback WeChat del server del tuo portale), la DNAT Destination (il server che gestisce i reindirizzamenti dei client non autenticati) e il Grace Period (la finestra temporale durante la quale un utente disconnesso di recente può riconnettersi senza doversi riautenticare, impostata di default a 60 minuti). Configura inoltre la whitelist del walled garden per consentire il traffico verso gli endpoint API di WeChat durante la fase di autenticazione. Vedi anche la Guida passo-passo: Configurazione dei controller wireless Ruijie per i Captive Portal WiFi guest per modelli di configurazione del controller comparabili.

Rilevamento del browser in-app

Il browser in-app di WeChat imposta una stringa user agent contenente MicroMessenger. Il tuo portale deve rilevare questa stringa e fornire il flusso OAuth appropriato. Se MicroMessenger è presente, utilizza il flusso Official Accounts. Se assente, utilizza il flusso con codice QR di Open Platform. La mancata rilevazione corretta produce un'esperienza utente interrotta o errori di autenticazione.

Best practice

Minimizzazione dei dati e conformità al doppio framework

Il GDPR (applicabile ai visitatori europei) e la PIPL (applicabile ai cittadini cinesi) richiedono entrambi una base giuridica per il trattamento dei dati personali, una chiara limitazione delle finalità e la minimizzazione dei dati. Lo scope snsapi_base è più facile da giustificare in base ai principi di minimizzazione dei dati rispetto a snsapi_userinfo. Quando raccogli dati demografici tramite snsapi_userinfo, documenta la tua base giuridica, il periodo di conservazione e l'accordo sul trattamento dei dati con Tencent.

La PIPL, in vigore da novembre 2021, richiede il consenso esplicito per le informazioni personali sensibili e impone ai responsabili del trattamento dei dati al di fuori della Cina di implementare standard di protezione equivalenti. Se il server del tuo portale si trova al di fuori della Cina continentale, devi valutare se le regole sul trasferimento transfrontaliero dei dati si applicano all'OpenID di WeChat e ai dati del profilo che ricevi.

UnionID per implementazioni multi-struttura

L'OpenID è unico per utente per ciascun Official Account. Se gestisci più Official Account in diverse strutture, lo stesso ospite avrà OpenID diversi in ognuna di esse. WeChat fornisce un UnionID che rimane coerente in tutti gli account collegati alla stessa registrazione sulla Open Platform. Per catene alberghiere, gruppi retail o operatori aeroportuali che gestiscono più sedi, implementa la risoluzione dell'identità basata su UnionID fin dall'inizio.

Rafforzamento della sicurezza

Memorizza l'AppSecret in una variabile d'ambiente o in un gestore di segreti (secrets manager), mai nel codice sorgente. Ruotalo immediatamente se sospetti un'esposizione. Implementa il rate limiting sul tuo endpoint di scambio token per prevenire abusi. Registra tutti gli errori OAuth, in particolare il 40029 (codice non valido) e il 40163 (codice scaduto), poiché indicano una configurazione errata o un tentativo di probing attivo.

Per una visione più ampia dell'architettura di sicurezza delle reti guest, consulta Perché i dispositivi WiFi consumer non dovrebbero essere usati nella tua rete guest .

Casi di studio

Catena di hotel di lusso, Singapore

Un hotel di lusso da 350 camere a Singapore, che si rivolge prevalentemente a un segmento di viaggiatori d'affari cinesi, ha implementato l'autenticazione WeChat WiFi insieme all'opzione di accesso tramite e-mail esistente. Prima dell'implementazione, il personale della reception segnalava una media df 15 reclami al giorno da parte degli ospiti per difficoltà di accesso al WiFi. Gli ospiti cinesi tentavano di utilizzare indirizzi e-mail che non avevano configurato sui loro dispositivi di viaggio.

L'hotel ha registrato un Service Account sulla WeChat Official Accounts Platform e una Website Application sulla Open Platform. Ha configurato snsapi_userinfo per le prime connessioni e snsapi_base per gli ospiti di ritorno identificati tramite indirizzo MAC. Il controller HPE Aruba è stato configurato per RADIUS CoA per gestire la promozione della sessione.

Entro 30 giorni, i reclami per l'accesso al WiFi degli ospiti sono scesi a meno di due al giorno. Il database di WiFi Analytics dell'hotel è cresciuto di 4.200 profili di prima parte verificati nel primo mese, con dati demografici a livello di città che hanno consentito comunicazioni post-soggiorno mirate.

Centro commerciale internazionale, Kuala Lumpur

Un centro commerciale di lusso a Kuala Lumpur, con 12 milioni di utenti WeChat solo in Malesia, aveva bisogno di un'esperienza di onboarding WiFi all'altezza delle aspettative digitali della sua clientela. Il centro commerciale gestiva access point Cisco Meraki su una superficie di vendita di 180.000 metri quadrati.

L'implementazione ha utilizzato la piattaforma Guest WiFi di Purple come overlay cloud, con WeChat OAuth come metodo di autenticazione primario e SMS OTP come fallback. L'architettura indipendente dall'hardware di Purple ha gestito l'integrazione RADIUS CoA con Cisco Meraki senza richiedere sviluppi personalizzati.

Il centro commerciale ha registrato un aumento del 34% nell'avvio di sessioni WiFi nel primo trimestre successivo all'implementazione, attribuito alla riduzione degli ostacoli all'onboarding per gli utenti WeChat. I dati di prima parte raccolti tramite i flussi di consenso snsapi_userinfo hanno consentito al team di marketing del centro commerciale di segmentare gli acquirenti in base alla città di provenienza per l'invio di campagne mirate.

retail_venue_wechat_wifi.png

Risoluzione dei problemi e mitigazione dei rischi

Errore Causa Risoluzione
40029 invalid code Mancata corrispondenza dell'URI di reindirizzamento o riutilizzo del codice Verificare che gli URI registrati corrispondano esattamente; i codici sono monouso
40163 code expired Scambio di token ritardato oltre i 5 minuti Ridurre i tempi di elaborazione lato server; implementare la logica di riprovo
Schermata vuota dopo l'autenticazione RADIUS CoA non configurato o non funzionante Verificare le impostazioni CoA del controller e le regole del firewall sulla porta UDP 3799
La randomizzazione del MAC interrompe il flusso degli ospiti di ritorno Randomizzazione MAC iOS/Android Migrare al tracciamento della sessione basato su OpenID; evitare l'identificazione basata solo su MAC
snsapi_userinfo restituisce campi vuoti L'utente ha impostato restrizioni sulla privacy di WeChat Gestire i campi nulli in modo corretto; non richiedere i dati del profilo per l'accesso

ROI e impatto aziendale

Il business case per l'autenticazione WiFi WeChat si basa su tre risultati misurabili.

Acquisizione di dati di prima parte. Ogni autenticazione snsapi_userinfo genera un profilo ospite verificato con dati demografici. Per un hotel di 200 camere con un'occupazione del 70% e il 40% di ospiti cinesi, ciò rappresenta circa 20.000 nuovi profili verificati all'anno, ciascuno legato a un'identità WeChat che supporta il re-engagement continuo.

Riduzione del carico di supporto. Gli ostacoli all'accesso sono la causa principale delle chiamate di supporto per il WiFi degli ospiti. Le strutture che aggiungono l'autenticazione WeChat alle opzioni esistenti registrano costantemente una riduzione delle richieste alla reception relative al WiFi, liberando tempo del personale per interazioni di maggior valore.

Portata del marketing. I WeChat Official Accounts consentono alle strutture di inviare notifiche push ai follower. Un ospite che si autentica tramite il vostro Official Account può essere invitato a seguirlo, creando un canale di comunicazione diretto che opera all'interno dell'ecosistema di WeChat, dove i consumatori cinesi trascorrono in media 82 minuti al giorno (fonte: Walk the Chat).

Il piano Engage di Purple estende ulteriormente questo aspetto, consentendo messaggi post-visita automatizzati, trigger di fidelizzazione e campagne segmentate create sulla base dei dati di prima parte raccolti al momento dell'autenticazione WiFi.

Definizioni chiave

Captive portal

A web-based authentication gateway that intercepts HTTP traffic from an unauthenticated device and redirects it to a login page before granting network access.

The mechanism through which guest WiFi authentication is presented to users. WeChat OAuth is one of several authentication methods a captive portal can offer.

OAuth 2.0

An industry-standard authorisation protocol that allows a third-party application (the captive portal) to obtain limited access to a web service (WeChat) on behalf of a user, without the user sharing their password with the third party.

The underlying framework that makes WeChat login possible. The portal never sees the user's WeChat credentials; it only receives a token confirming that WeChat has authenticated them.

RADIUS CoA

Change of Authorisation. A mechanism defined in RFC 3576 that allows a RADIUS server to dynamically modify the session authorisation attributes of an active network client, such as changing VLAN assignment.

The network enforcement mechanism that translates a successful WeChat OAuth exchange into actual network access. Without CoA, the guest authenticates but the controller does not know to open the network.

OpenID

A unique identifier assigned by WeChat to a specific user for a specific Official Account or Website Application. It is stable across sessions but differs across accounts.

The primary key used to identify a guest in your WiFi analytics database. Use UnionID instead if you operate multiple Official Accounts and need cross-account identity resolution.

snsapi_base

A WeChat OAuth scope that enables silent authentication, returning only the user's OpenID without displaying a consent prompt.

Use for returning guests or high-throughput environments where connection speed is the priority. Returns no demographic data beyond the OpenID.

snsapi_userinfo

A WeChat OAuth scope that returns the user's OpenID, nickname, profile image, gender, language, and city, requiring an explicit user consent screen.

Use for first-time guest registration to build a first-party data profile. Must be paired with a GDPR and PIPL-compliant consent layer.

PIPL

Personal Information Protection Law. China's comprehensive data privacy legislation, in force since November 2021, governing how personal data of Chinese citizens must be collected, processed, and transferred.

Applies to any venue that collects data from Chinese citizens via WeChat OAuth, regardless of where the venue is located. Requires explicit consent, purpose limitation, and data minimisation.

AppSecret

A confidential cryptographic key issued by WeChat that authenticates your application when it calls WeChat's token exchange API.

Must be stored on the server side only. Exposure in client-side code allows any party to impersonate your application and make unauthorised API calls to WeChat.

VLAN

Virtual Local Area Network. A logical network segment that isolates traffic at the data link layer, allowing a single physical network to carry multiple isolated traffic streams.

Used in captive portal deployments to separate unauthenticated devices (walled garden VLAN) from authenticated guests (guest VLAN). RADIUS CoA moves a device between VLANs upon successful authentication.

UnionID

A WeChat identifier that remains consistent for a given user across all Official Accounts and Website Applications linked to the same Open Platform registration.

Essential for hotel chains, retail groups, and multi-venue operators who need to recognise the same guest across multiple properties, each with its own Official Account.

Esempi pratici

A 200-room luxury hotel in Singapore uses HPE Aruba controllers and serves a high volume of Chinese business travellers. They want to collect demographic data from first-time guests and ensure returning guests connect automatically without seeing the portal again. How should they configure the WeChat OAuth integration?

Step 1: Register a Service Account on the WeChat Official Accounts Platform (mp.weixin.qq.com) to handle guests accessing the portal inside the WeChat in-app browser. Register a Website Application on the WeChat Open Platform (open.weixin.qq.com) for guests on standard mobile browsers.

Step 2: Configure the captive portal to detect the MicroMessenger user agent string. Serve the Official Accounts OAuth flow for in-app browser users and the Open Platform QR code flow for standard browser users.

Step 3: For first-time connections (no existing OpenID in the database), request snsapi_userinfo scope. Present a PIPL-compliant consent screen before the OAuth redirect. Store the returned OpenID, nickname, city, and gender in the guest profile database.

Step 4: For returning guests (OpenID exists in the database), request snsapi_base scope. This authenticates silently with no user-visible prompt.

Step 5: Configure the HPE Aruba controller for RADIUS CoA on UDP port 3799. After successful OAuth, the portal server sends a CoA request to promote the device from the walled garden VLAN to the guest VLAN.

Step 6: Implement MAC address logging alongside OpenID to handle the returning guest detection. Note that MAC randomisation requires OpenID as the primary identifier, not MAC address alone.

Commento dell'esaminatore: This approach correctly separates the two platform registrations by access context, uses scope selection to balance friction against data collection, and implements RADIUS CoA for secure network enforcement. The use of OpenID as the primary returning-guest identifier is the correct response to MAC randomisation. The PIPL consent layer is non-negotiable for Chinese citizen data.

A retail chain's IT team reports a high failure rate for WeChat WiFi logins across three mall locations. Users authenticate in WeChat but are returned to the portal page with an error. The portal logs show error 40029. What is the likely cause and how do you resolve it?

Error 40029 means WeChat rejected the authorisation code during the token exchange. The two most common causes are a redirect URI mismatch and code reuse.

Step 1: Log into the WeChat developer console for both the Official Accounts Platform and the Open Platform. Navigate to the OAuth settings and list all registered redirect URIs.

Step 2: Compare these against the actual redirect URIs your portal server uses in production across all three locations. Check for subdomain differences (portal.brand.com vs brand.com), protocol differences (HTTP vs HTTPS), and path differences (/callback vs /wechat/callback).

Step 3: Register every variant in the WeChat console. WeChat performs exact-match validation, not prefix matching.

Step 4: If the URIs match, investigate whether your portal server is attempting to reuse authorisation codes. WeChat codes are single-use and expire after five minutes. If your server retries the token exchange with the same code, it will receive 40029 on the second attempt.

Step 5: Implement idempotency in the token exchange endpoint to prevent duplicate requests.

Commento dell'esaminatore: Error 40029 is the most common error in WeChat OAuth deployments and is almost always caused by a redirect URI mismatch. Multi-location deployments are particularly vulnerable because each location may use a different subdomain or load balancer address. The secondary cause, code reuse, is less common but worth checking if URI registration is confirmed correct.

Domande di esercitazione

Q1. You are deploying a captive portal for a 60,000-capacity stadium hosting international events with a significant Chinese fan base. The priority is getting all attendees online within the first 15 minutes of doors opening to reduce cellular congestion. Marketing data collection is a secondary objective. Which WeChat OAuth scope should you configure, and why?

Suggerimento: Consider the impact of a consent screen displayed to 15,000 simultaneous users on a portal server.

Visualizza risposta modello

Configure snsapi_base scope. This enables silent authentication with no user consent prompt, providing the fastest possible onboarding experience. At stadium scale, a consent screen adds friction that multiplies across thousands of simultaneous connections and can cause portal server load spikes. snsapi_base returns only the OpenID, which is sufficient to log the session and identify returning fans. For first-time fans where you want demographic data, you can prompt for profile completion via a post-connection survey rather than at the authentication gate.

Q2. A network architect on your team proposes storing the WeChat AppSecret in the captive portal's client-side JavaScript to reduce server round-trips by making the token exchange call directly from the browser. Explain why this approach is a critical security failure and what the correct architecture is.

Suggerimento: Consider who can view client-side code and what the AppSecret allows them to do.

Visualizza risposta modello

Storing the AppSecret in client-side JavaScript exposes it to any person who views the page source or intercepts network traffic. The AppSecret authenticates your application to WeChat's API. With it, a malicious actor can impersonate your application, call WeChat's token exchange endpoint with any valid authorisation code, retrieve user OpenIDs and profile data, and potentially exhaust your API rate limits. The correct architecture is a server-side token exchange endpoint. The browser receives the authorisation code from WeChat and passes it to your server. Your server, using the AppSecret stored in an environment variable or secrets manager, exchanges the code for a token and returns only the data the portal needs. The AppSecret never leaves your server.

Q3. Your venue operates three hotel properties in different cities, each with its own WeChat Official Account. A loyalty programme member who has authenticated at all three properties has three different OpenIDs in your database. How do you resolve this into a single guest identity?

Suggerimento: WeChat provides a mechanism for cross-account identity resolution that requires a specific platform configuration.

Visualizza risposta modello

Implement WeChat's UnionID mechanism. Link all three Official Accounts to the same Open Platform registration at open.weixin.qq.com. Once linked, WeChat returns a UnionID alongside the OpenID in the snsapi_userinfo response. The UnionID is consistent for a given user across all accounts linked to the same Open Platform registration. Migrate your database to use UnionID as the primary guest identifier for cross-property records, retaining the per-account OpenID for account-specific API calls. For guests who authenticated before UnionID was implemented, trigger a re-authentication with snsapi_userinfo at their next visit to capture the UnionID.

Q4. After deploying WeChat WiFi authentication at a retail venue running Cisco Meraki access points, guests report that they complete the WeChat login successfully but are returned to the portal page and cannot browse the internet. The portal server logs show successful token retrieval. What is the most likely cause and how do you diagnose it?

Suggerimento: The portal has verified identity. What has not happened yet?

Visualizza risposta modello

The RADIUS Change of Authorisation (CoA) is not completing. The portal server has verified the guest's identity via WeChat OAuth but has not successfully instructed the Cisco Meraki controller to move the device from the walled garden VLAN to the guest VLAN. Diagnose by checking: (1) whether the Meraki controller has RADIUS CoA enabled and the portal server's IP is listed as an authorised CoA client; (2) whether UDP port 3799 is open between the portal server and the controller; (3) the portal server logs for CoA request errors or timeouts; and (4) whether the shared secret configured on both sides matches. If CoA is not supported in your Meraki licence tier, MAC address bypass is the fallback, though it carries the MAC randomisation risk noted in the guide.

Continua a leggere questa serie

Integrazione di Cisco WLC e Catalyst con Purple WiFi: guida passo-passo all'accesso guest

Questa guida descrive in dettaglio l'integrazione passo-passo di Cisco WLC e Catalyst 9800 Wireless con Purple, coprendo il reindirizzamento al Captive Portal per Guest WiFi tramite Central Web Authentication, il WiFi aziendale sicuro per il personale tramite 802.1X EAP-TLS e la segmentazione multi-tenant tramite Cisco Identity Pre-Shared Keys (iPSK) con assegnazione dinamica della VLAN. È scritta per architetti di rete aziendali e direttori della sicurezza IT che distribuiscono l'infrastruttura Cisco nei settori hospitality, retail e grandi spazi pubblici.

Leggi la guida →

Guida alla configurazione SCEP aziendale: autenticazione Wi-Fi basata su certificati per l'istruzione superiore e le grandi reti

Questa guida fornisce un progetto tecnico completo per l'implementazione dell'autenticazione WiFi basata su certificati tramite SCEP. Copre la transizione architetturale dalle chiavi precondivise a EAP-TLS, le sequenze di implementazione sulle piattaforme MDM e le strategie critiche di mitigazione del rischio per le reti su larga scala.

Leggi la guida →

Guida all'integrazione di MikroTik RouterOS Captive Portal e Purple WiFi

Questa guida tecnica fornisce istruzioni dettagliate per l'integrazione di MikroTik RouterOS con la piattaforma Purple WiFi. Copre la configurazione del Captive Portal per il WiFi ospiti, l'autenticazione 802.1X per il WiFi dipendenti e il WiFi multi-tenant utilizzando PSK privati per la segmentazione dinamica delle VLAN.

Leggi la guida →