Trying to call nonInteractiveSsoLogin at the right time
I'm implementing Comentario and the single sign-on. I've done this before in Commento, but with that project being abandoned I'm now implementing the same in Comentario
I have it installed and running in docker, have logged onto the admin as a super user, created a domain, configured the domain to use non-interactive SSO.
I've also added the markup to my site, and it's showing fine. Prior to making the site SSO only I allowed local logins and was able to post comments.
With the above config I am attempting to perform the SSO login, but when I attempt the nonInteractiveSsoLogin()
I get the error "Non-interactive SSL is not enabled"
I noticed that it comes before the "Initialised Comentario" comment which makes the error make sense as I'm obviously calling it too soon, and I found also that if I run the call to nonInteractiveSsoLogin
in the console afterwards, or use a window.setTimeout()
to introduce a delay it works fine.
My full code:
<script defer src="https://comentario.example.com/comentario.js"></script>
<comentario-comments></comentario-comments>
<script>
document.getElementsByTagName('comentario-comments').item(0).nonInteractiveSsoLogin();
</script>
I'm using plain JS on this site. I would appreciate any hints as to the right way to call nonInteractiveSsoLogin()
. Thanks.