hi every one,
as i saw in the 3.5.2 new features "Embedded content from the site in iframes now works in the app"
now i have a question...
We're on 3.5.2 and latest app. I have some embedded H5P activities which work fine on desktop, but display "You do not have access to this content. Try logging in' in the mobile app. Am I to understand that this iss that how it should be, still - or am I missing some settings to get this working? I'm using the ATTO editor plugin which produces the following code:
<iframe src="https://SERVER_ADDRESS_MASKED/develop/moodle/mod/hvp/embed.php?id=4383" class="filter_hvp" id="hvp_4383" style="width:100%; height:auto; border:0;" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
<script src="https://SERVER_ADDRESS_MASKED/develop/moodle/mod/hvp/library/js/h5p-resizer.js" charset="UTF-8"></script>
Many thanks in advance
this issue was fixed for 3.5.2 version of the app (latest), but the solution has some limitations. We use auto-login to authenticate the user in the H5P activity (see this Moodle issue for more information). The requirements to make this work are:
- The site needs to use Moodle 3.2 or higher.
- The site needs to use https, not http.
- The user needs to have a private token. This is created when the user token is created (the user authenticates in the app). If the user authenticated in the app when your server was using a Moodle older than 3.2 you might need to invalidate all tokens to force them to re-create the token. You can see the private tokens in the database, table external_tokens, there is a privatetoken column.
- A user can only auto-login once every 6 minutes. Auto-login is usually triggered when an iframe pointing to the site is viewed in the app (your case) or when the app opens a URL pointing to the site in the browser of the device. Please notice that the session in an iframe is usually kept for a while unless the user restarts the app, this means that if the user views the H5P and it works he'll be able to view it again without triggering the auto-login if he doesn't restart the app.
Really helpful - thanks very much.