Payments & Platform Access · Practical News

Configuring the Official Account JS Domain: Four Causes of Authorisation Failures

Source: Paddy Dance teamKeywords: official account JS domain setup

Two domains, two jobs

The web authorisation domain controls whether you can redirect to the authorisation page and receive a code. The JS safe domain controls whether wx APIs can be called on the page. A full H5 inside an Official Account usually needs both.

Enter the bare domain without scheme or path. Configuring www while users visit without www counts as a mismatch.

Verification files must sit in the right place

The platform asks for a verification file at the domain root, reachable over HTTPS. Frequent failures are rewrite rules blocking it, a 404 page with HTML instead of plain text, or a CDN caching old content.

Open the verification file URL in a browser first and confirm the content, then click verify on the platform.

When settings look right but still fail

Caching: the WeChat client caches pages, so clear cache or test with another account. Callback URLs with extra parameters or a port do not match the configuration. Or scope is snsapi_userinfo and the user cancels, with no fallback in code.

We help with configuration and the callback chain, including signature algorithms, access_token management and error handling. Entity qualification and interface permissions are decided by the platform.

FAQ

Can the authorisation domain differ from the JS domain?

It can, but keeping them identical reduces troubleshooting complexity. If they differ, ensure both verification files are deployed and reachable.

Can an unfiled domain be configured?

It is typically required to be filed. Even if configuration passes, access may be restricted, so complete filing first.

What causes a redirect_uri parameter error?

Usually the callback URL does not match the configured domain, or it is not URL-encoded. Check scheme, domain and path for an exact match, and confirm encoding.

Related questions

WeChat web authorisation failingJS safe domain verification fileShare API not workingWeb authorisation domain vs JS domain

Further reading

Sources & References

The following are public sources. Always check the latest requirements on the official authority or platform page.

Explain your case first, then confirm the scope

Tell us your entity, business model and current progress. We will confirm what we can assist with and what you need to do before discussing fees.