# HMAC-256 example on Official SSO page

**URL:** <https://meta.discourse.org/t/hmac-256-example-on-official-sso-page/92546>\
**Category:** SSO\
**Created:** [July 17, 2018, 3:08pm UTC](https://meta.discourse.org/t/hmac-256-example-on-official-sso-page/92546 "2018-07-17T15:08:00Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jehrlich](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jehrlich](https://meta.discourse.org/u/jehrlich)\
**Post date:** [July 17, 2018, 3:08pm UTC](https://meta.discourse.org/t/hmac-256-example-on-official-sso-page/92546/1 "2018-07-17T15:08:01Z")

</div>

[Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/official-single-sign-on-for-discourse-sso/13045) has an HMAC-256 encoding “Real world example” I cannot duplicate.

> [@Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/setup-discourseconnect-official-single-sign-on-for-discourse-sso/13045/1):
>
> SSO secret: `d836444a9e4084d5b224a60c208dce14`
> 
> - Payload is Base64 encoded: `bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGI=\n`
> - HMAC-SHA256 is generated on the Base64 encoded Payload: `2828aa29899722b35a2f191d34ef9b3ce695e0e6eeec47deb46d588d70c7cb56`

There is an extra “'\n” appended to the Base64 encoded string, it should be

> bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGI=

Using [https://codebeautify.org/hmac-generator](https://codebeautify.org/hmac-generator) with HMAC-256 Algorithm on

`bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGI=`

I get

`1ce1494f94484b6f6a092be9b15ccc1cdafb1f8460a3838fbb0e0883c4390471`

Am I missing something?

---

_[View the full topic](https://meta.discourse.org/t/hmac-256-example-on-official-sso-page/92546)._
