Sign inSign up

iznow/ghost

By iznow

•Updated over 4 years ago

ghost + s3 + commento sso support

Image
0

5.0K

iznow/ghost repository overview

⁠To activate commento sso feature:

Create a page-commento.hbs in you theme, ie for casper:

{{#if @member}}
  <!DOCTYPE html>
  <html>
    <head>
        <meta charset="utf-8" />
        <script>
            const onLoad = (function() {
                var params = new URLSearchParams(location.search);
                var token = params.get('token');
                var hmac = params.get('hmac');
                var avatar = '{{@member.profile_image}}';
                window.location.href = '/commento/sso?token='+token+'&hmac='+hmac+'&avatar='+avatar;
            })();
        </script>
    </head>
    <body onLoad="onLoad();"></body>
  </html>
{{else}}
{{!< default}}
<section class="outer footer-cta">
    <div class="inner">
        <h2>Please signin to comment !!</h2>
        <a class="footer-cta-button" href="#/portal" data-portal>
            <div class="footer-cta-input">Enter your email</div>
            <span>Signin</span>
        </a>
    </div>
</section>
{{/if}}

Then create an empty page from admin panel named commento to expose commento page. This is required to forward auth cookies from browser session.

⁠On commento:

  • Activate Single Sign On Authentication Options
  • Add https://GHOST_FRONT_URL/commento as REDIRECT URL
  • Copy the HMAC SHARED SECRET KEY as secret

⁠Then set env vars deploying ghost:

  • commento__serverUrl=https://COMMENTO_URL
  • commento__sso__secret=secret from commento

Tag summary

Content type

Image

Digest

Size

149.4 MB

Last updated

about 5 years ago

docker pull iznow/ghost