Jeffery, you are absolutely correct sir. I am only adding this as an answer to expand upon yours with some additional security recommendations Weebly considers best practice.
The primary use cases when developers need to implement the JWT
"JSON Web Token" are (see links in Jeffery's answer above for more details):
- Providing user-contextualized data for Weebly Apps dependent upon configuration/setting parameters to be defined/stored/manipulated outside of Weebly (external services)
SSO
(Single-Sign On) support
Two Ways the :jwt
is included in the URL
Your Weebly App manifest.json
file(s) may contain URLs that trigger Weebly to provide you a JWT:
manage_app_url
element.settings.config.external.url
- Dashboard Card Link Components -->
dashboard_cards.link
|| dashboard_cards.default[{{SOME_COMPONENT}}].link
Developers can define the position of the JWT in these URLs using one of two approaches:
- IMPLICITLY DEFINED: Weebly automatically appends the JWT string to the developer-defined URL (and any appropriate operands such as & or ?)
- EXPLICITLY DEFINED: Indicated by using
:jwt
at any valid location within the URL values you provide in your manifest.json
file
Production Security Best Practices and Considerations
Using the decode
method of the PHP library above is handy and quick during development, but when developers are ready to publish their Weebly Apps to the App Center, you will want to include the maximum security possible.
- Request Scheme Invalidation: Verify the scheme of the inbound request is using
https
- Request Domain Invalidation: Verify the
headers.host
of the inbound request contains the valid weebly
domain and .com
TLD (since requests containing the JWT should only ever come from https://www.weebly.com
- Auto-Reject Tokens with Mismatched Signature Types: Some JWT libraries do not auto-reject tokens if the signature type is mis-matched, which allows hackers to forge requests in these case read this document from Auth0 for more information
- IP Address Max Requests per [TIMEFRAME]: To prevent brute-force hacking or DDOS attacks on these URLs, you may want to include functionality that automatically caches multiple requests within a specific timeframe. This should be a relatively high-value in a short-period of time, since humans can have request performance limitations in valid use-cases.
While the above content about security is not currently part of official Weebly documentation, I have submitted an issue to include it in the future.
Also, I saw that we recently moved content and did not include the 301 redirects for the URLs referenced in the original question or Jeffery's answer. We just fixed that so your links work properly.
I hope this helps and the information is valuable for you.