Question
Best Approach for Token-Based Prefill in AEM Forms via iFrame
Hi AEM Community,
I'm working on an AEM Forms implementation and need some guidance on the best approach for the following use case:
Requirements:
- The form is embedded in an iFrame on an external website
- The parent page URL contains a
tokenparameter that needs to be captured - This token must be used to make a backend API call to retrieve user data
- The API response should prefill specific form fields (name and email)
Flow:
Parent URL (with token) → iFrame loads AEM Form → Capture token → Backend API call → Prefill form fields
My Questions:
- What's the recommended approach for this scenario in AEM Forms?
- Custom Prefill Service vs Client-side implementation?
- How to properly capture URL parameters from parent window when in iFrame?
- Should I create a custom servlet/OSGi service to proxy the external API call, or can this be handled differently?
- Are there any OOTB features in AEM Forms that would simplify this implementation?
Has anyone implemented a similar pattern? What approach worked best for you?
Any guidance, code samples, or best practices would be greatly appreciated!
Thanks in advance!
