Single sign on redirect for AMP
Redirect engaged users to the full HTML experience of your site
AMP pages are cached on a third-party server instead of being served from your own domain. Therefore, the SSO process cannot be completed directly on an AMP page.
As an alternative, it is possible to implement a read-only Conversation on your AMP pages and redirect your users to a non-AMP mobile page when necessary. Actions that do not require authentication can still be performed directly on the AMP page.
Implementation
- Locate the source code of the Conversation iframe in the AMP code.
In the following simplified example,https://amp.spot.im/production.html?spot_im_highlight_immediate=true&redirect=true&spotId=SPOT_ID&postId=POST_ID
is the Conversation implementation code.
<amp-iframe
width="375"
height="350"
resizable
sandbox="allow-scripts allow-same-origin allow-popups allow-top-navigation"
layout="responsive"
frameborder="0"
src="https://amp.spot.im/production.html?spot_im_highlight_immediate=true&redirect=true&spotId=SPOT_ID&postId=POST_ID"
>
- Modify the Conversation implementation code:
• Removeredirect=true
.
• Appendinactive=true
.
• Appenddata-post-url='https%3A%2F%2Fwww.ENCODED-ARTICLE-URL.com'
.
Using a
data-post-url
with any of the following characteristics may lead your users to a broken or incorrect link after clicking on the Conversation:
- Contains unencoded characters in the URL
- Leads to a page that does not have a Conversation on it
<amp-iframe
width="375"
height="350"
resizable
sandbox="allow-scripts allow-same-origin allow-popups allow-top-navigation"
layout="responsive"
frameborder="0"
src="https://amp.spot.im/production.html?spot_im_highlight_immediate=true&spotId=SPOT_ID&postId=POST_ID&inactive=true&data-post-url='https%3A%2F%2Fwww.ENCODED-ARTICLE-URL.com'"
>
- On your non-AMP page, implement OpenWeb's standard or third-party single sign on.
Updated 12 months ago