<!doctypehtml><meta charset=utf-8><meta content=ie=edge http-equiv=x-ua-compatible><meta content=width=device-width,initial-scale=1,shrink-to-fit=no name=viewport><style data-href=/commons.6d0f0a9c467420f51c6c.css>/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta content="Gatsby 2.15.17"name=generator><title data-react-helmet=true>
   Authentication | LoyaltyLion Developer Portal
  </title><link data-react-helmet=true href=https://fonts.googleapis.com/css?family=Muli:300,400,600,700|Source+Code+Pro rel=stylesheet><style data-styled="gwYVmm hZKwzf cxfCUy MHzyv geCEcm dVqVQq hgJSRz dhqwLK ewtsKs kkHgDU iZyBAR faZXnm kzDOmA hgVJGJ dnREIL czwxpA hGZNLA"data-styled-version=4.3.2>/* sc-component-id: Container__StyledContainer-sc-1uo3bv1-0 */
.cxfCUy{margin:0 auto;} .cxfCUy.flex{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;} @media (min-width:1280px){.cxfCUy{width:1200px;}} @media (min-width:1140px) and (max-width:1280px){.cxfCUy{width:1060px;}} @media (min-width:900px) and (max-width:1140px){.cxfCUy{width:800px;}} @media (min-width:0px) and (max-width:900px){.cxfCUy{width:100%;padding-left:30px;padding-right:30px;}} @media (min-width:0px) and (max-width:680px){.cxfCUy{padding-left:20px;padding-right:20px;}}
/* sc-component-id: sc-global-4284500449 */
*{box-sizing:border-box;margin:0;padding:0;} html,body{font-family:Muli,'Source Sans Pro',sans-serif;background:white;} a{color:#582c83;} code{font-family:'Source Code Pro',Menlo,Monaco,Consolas,'Courier New',monospace;}
/* sc-component-id: sc-global-491748685 */
.gatsby-highlight{background:#36304a;color:white;border-radius:5px;overflow:auto;tab-size:1.5em;} .gatsby-highlight code{font-family:'Source Code Pro',Menlo,Monaco,Consolas,'Courier New',monospace;} .gatsby-highlight pre[class*='language-'],.gatsby-highlight pre.prism-code{height:auto !important;margin:1rem;font-size:14px;line-height:20px;white-space:pre-wrap;word-break:break-word;} .gatsby-highlight-code-line{background-color:#14161a;display:block;margin:-0.125rem calc(-1rem - 15px);padding:0.125rem calc(1rem + 15px);} .token.attr-name{color:#c5a5c5;} .token.attr-value{color:#8dc891;} .token.comment,.token.block-comment,.token.prolog,.token.doctype,.token.cdata{color:#999999;} .token.property,.token.number,.token.function-name,.token.constant,.token.symbol,.token.deleted{color:#5a9bcf;} .token.boolean{color:#ff8b50;} .token.tag{color:#fc929e;} .token.string{color:#8dc891;} .token.punctuation{color:#5fb3b3;} .token.selector,.token.char,.token.builtin,.token.inserted{color:#d8dee9;} .token.function{color:#79b6f2;} .token.operator,.token.entity,.token.url,.token.variable{color:#d7deea;} .token.keyword{color:#c5a5c5;} .token.atrule,.token.class-name{color:#fac863;} .token.important{font-weight:400;} .token.bold{font-weight:600;} .token.italic{font-style:italic;} .token.entity{cursor:help;} .token.namespace{opacity:0.7;}
/* sc-component-id: Header__Background-pyjs7s-0 */
.hZKwzf{background-color:#582c83;color:#fff;}
/* sc-component-id: Header__Flex-pyjs7s-1 */
.MHzyv{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}
/* sc-component-id: Header__LogoLink-pyjs7s-2 */
.geCEcm{color:white;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-text-decoration:none;text-decoration:none;font-weight:300;} .geCEcm > span{padding:20px 20px 20px 12px;} @media (min-width:680px) and (max-width:900px){.geCEcm > span{display:none;}} @media (min-width:0px) and (max-width:680px){.geCEcm > span{display:none;}} .geCEcm > img{width:32px;height:32px;margin-top:13px;}
/* sc-component-id: Header__Nav-pyjs7s-3 */
.dVqVQq{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}
/* sc-component-id: Header__NavItem-pyjs7s-4 */
.hgJSRz{color:white;font-weight:300;-webkit-text-decoration:none;text-decoration:none;display:inline-block;padding:20px 20px 16px 20px;border-bottom:4px solid transparent;} .hgJSRz:hover{background-color:rgba(255,255,255,0.08);} .hgJSRz.active{border-bottom-color:#f38900;}
/* sc-component-id: Layout__Page-sc-1mygr1y-0 */
.gwYVmm{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;min-height:100vh;}
/* sc-component-id: Menu__MenuHeading-sc-1whidny-0 */
.iZyBAR{font-weight:700;text-transform:uppercase;-webkit-letter-spacing:1px;-moz-letter-spacing:1px;-ms-letter-spacing:1px;letter-spacing:1px;color:#582c83;font-size:0.9em;line-height:1.5em;}
/* sc-component-id: Menu__MenuList-sc-1whidny-1 */
.faZXnm{list-style:none;margin:0;padding:11px 0 17px 5px;} .faZXnm > li{list-style:none;margin:0;}
/* sc-component-id: Menu__MenuListItemLink-sc-1whidny-2 */
.kzDOmA{color:#111;-webkit-text-decoration:none;text-decoration:none;display:inline-block;border-right:3px solid transparent;width:100%;padding:6px;margin-left:-5px;} .kzDOmA:hover{background-color:#fcfcfc;} .kzDOmA.active{border-right-color:#f38900;background-color:#fcfcfc;color:#111;font-weight:600;}
/* sc-component-id: Menu__Sticky-sc-1whidny-3 */
.kkHgDU{padding:40px 0;position:-webkit-sticky;position:sticky;top:0;} @media (max-height:900px){.kkHgDU{position:static;}}
/* sc-component-id: Sidebar__SidebarContainer-q8j3dx-0 */
.dhqwLK{margin-right:40px;-webkit-flex:0 0 300px;-ms-flex:0 0 300px;flex:0 0 300px;} @media (min-width:1140px) and (max-width:1280px){.dhqwLK{-webkit-flex:0 0 260px;-ms-flex:0 0 260px;flex:0 0 260px;}} @media (min-width:900px) and (max-width:1140px){.dhqwLK{-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px;}} @media (min-width:0px) and (max-width:900px){.dhqwLK{display:none;position:fixed;margin:0;top:0;right:0;left:0;bottom:0;overflow-y:auto;background-color:#f7f7f7;z-index:500;}.dhqwLK.open{display:block;}}
/* sc-component-id: Sidebar__SidebarBackground-q8j3dx-1 */
.ewtsKs{background-color:#f7f7f7;height:100%;margin-left:-999px;padding-left:999px;} @media (min-width:0px) and (max-width:900px){.ewtsKs{margin:0 auto;padding:0 30px;max-width:500px;}}
/* sc-component-id: Sidebar__SidebarToggleButton-q8j3dx-2 */
.hgVJGJ{display:none;} @media (min-width:0px) and (max-width:900px){.hgVJGJ{display:block;cursor:pointer;position:fixed;width:50px;height:50px;border-radius:100%;right:15px;bottom:15px;z-index:1000;background:#333 url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDI0IDI0IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNCAyNCIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4Ij4KICA8Zz4KICAgIDxwYXRoIGQ9Ik0yNCwzYzAtMC42LTAuNC0xLTEtMUgxQzAuNCwyLDAsMi40LDAsM3YyYzAsMC42LDAuNCwxLDEsMWgyMmMwLjYsMCwxLTAuNCwxLTFWM3oiIGZpbGw9IiNGRkZGRkYiLz4KICAgIDxwYXRoIGQ9Ik0yNCwxMWMwLTAuNi0wLjQtMS0xLTFIMWMtMC42LDAtMSwwLjQtMSwxdjJjMCwwLjYsMC40LDEsMSwxaDIyYzAuNiwwLDEtMC40LDEtMVYxMXoiIGZpbGw9IiNGRkZGRkYiLz4KICAgIDxwYXRoIGQ9Ik0yNCwxOWMwLTAuNi0wLjQtMS0xLTFIMWMtMC42LDAtMSwwLjQtMSwxdjJjMCwwLjYsMC40LDEsMSwxaDIyYzAuNiwwLDEtMC40LDEtMVYxOXoiIGZpbGw9IiNGRkZGRkYiLz4KICA8L2c+Cjwvc3ZnPgo=) no-repeat 50% 50%;background-size:20px;}.hgVJGJ.active{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDIxLjkgMjEuOSIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjEuOSAyMS45IiB3aWR0aD0iNTEycHgiIGhlaWdodD0iNTEycHgiPgogIDxwYXRoIGQ9Ik0xNC4xLDExLjNjLTAuMi0wLjItMC4yLTAuNSwwLTAuN2w3LjUtNy41YzAuMi0wLjIsMC4zLTAuNSwwLjMtMC43cy0wLjEtMC41LTAuMy0wLjdsLTEuNC0xLjRDMjAsMC4xLDE5LjcsMCwxOS41LDAgIGMtMC4zLDAtMC41LDAuMS0wLjcsMC4zbC03LjUsNy41Yy0wLjIsMC4yLTAuNSwwLjItMC43LDBMMy4xLDAuM0MyLjksMC4xLDIuNiwwLDIuNCwwUzEuOSwwLjEsMS43LDAuM0wwLjMsMS43QzAuMSwxLjksMCwyLjIsMCwyLjQgIHMwLjEsMC41LDAuMywwLjdsNy41LDcuNWMwLjIsMC4yLDAuMiwwLjUsMCwwLjdsLTcuNSw3LjVDMC4xLDE5LDAsMTkuMywwLDE5LjVzMC4xLDAuNSwwLjMsMC43bDEuNCwxLjRjMC4yLDAuMiwwLjUsMC4zLDAuNywwLjMgIHMwLjUtMC4xLDAuNy0wLjNsNy41LTcuNWMwLjItMC4yLDAuNS0wLjIsMC43LDBsNy41LDcuNWMwLjIsMC4yLDAuNSwwLjMsMC43LDAuM3MwLjUtMC4xLDAuNy0wLjNsMS40LTEuNGMwLjItMC4yLDAuMy0wLjUsMC4zLTAuNyAgcy0wLjEtMC41LTAuMy0wLjdMMTQuMSwxMS4zeiIgZmlsbD0iI0ZGRkZGRiIvPgo8L3N2Zz4K);background-size:16px;}}
/* sc-component-id: Article-ad95cn-0 */
.dnREIL{background-color:white;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;padding:40px 0 100px 0;font-size:1em;} @media (min-width:0px) and (max-width:900px){.dnREIL{width:100%;}} .dnREIL h1{margin-top:0;font-size:2.6em;font-weight:300;color:#582c83;} .dnREIL h2{margin-top:40px;padding-top:20px;border-top:1px solid #ececec;line-height:1.2;font-size:1.8em;font-weight:600;} .dnREIL h2 > code{word-break:break-word;} @media (min-width:900px) and (max-width:1140px){.dnREIL h2{font-size:1.6em;}} .dnREIL h3{padding-top:30px;font-size:1.6em;font-weight:400;} .dnREIL hr{margin-top:30px;border:none;height:1px;background:#e9e9e9;} .dnREIL p{margin-top:21px;line-height:1.7;} .dnREIL p,.dnREIL li{font-size:17px;} .dnREIL li > p{margin:0;padding:0;} .dnREIL ul{margin-top:20px;} .dnREIL ul > li{margin-left:40px;line-height:2;} .dnREIL ul > li > ul{margin-top:0;} .dnREIL ul > li > ul > li{margin-left:22px;font-size:0.9em;} .dnREIL p{max-width:42em;} .dnREIL p > code,.dnREIL li > code{background:rgba(255,229,100,0.2);padding:0 3px;color:#1a1a1a;} .dnREIL .gatsby-highlight{margin-top:25px;margin-bottom:5px;} .dnREIL .tab-group .gatsby-highlight{margin-top:0;} .dnREIL .gatsby-resp-image-wrapper{box-shadow:0 1px 3px 1px rgba(0,0,0,0.06);margin-top:30px;margin-left:0 !important;margin-right:0 !important;} .dnREIL .gatsby-resp-image-background-image[style]{display:block !important;background-size:cover !important;} .dnREIL table{width:100%;border-collapse:collapse;margin-top:25px;border-radius:4px;} .dnREIL table thead tr{background:#36304a;height:40px;} .dnREIL table thead th{color:#fff;font-size:1em;font-weight:600;line-height:1.2;padding-left:15px;text-align:left;} .dnREIL table thead th:first-child{border-top-left-radius:5px;} .dnREIL table thead th:last-child{border-top-right-radius:5px;} .dnREIL table tbody tr{height:40px;color:#444;background-color:#fcfcfc;} .dnREIL table tbody tr:nth-child(even){background-color:#f5f5f5;} .dnREIL table tbody td{padding:5px 15px;line-height:1.5;} .dnREIL table tbody td > code{white-space:nowrap;font-size:0.9em;} .dnREIL .callout{border-left:6px solid transparent;padding:20px 45px 20px 25px;margin-top:25px;background-color:rgb(245,247,249);border-radius:4px 0 0 4px;} .dnREIL .callout.yellow{border-left-color:rgb(247,125,5);} .dnREIL .callout.blue{border-left-color:rgb(56,132,255);} .dnREIL .callout.blue code{background:rgba(56,132,255,0.1);} .dnREIL .callout > p:first-child{margin-top:0;} .dnREIL .callout > p:nth-child(2){margin-top:10px;} .dnREIL .live-preview{margin:21px -10px 40px -10px;}
/* sc-component-id: TabGroup__TabGroupDiv-bieer2-0 */
.czwxpA{margin-top:25px;} .czwxpA .tab{display:none;} .czwxpA .tab.visible{display:block;} .czwxpA .tab .gatsby-highlight{margin-top:0;}
/* sc-component-id: TabGroup__TabGroupNav-bieer2-1 */
.hGZNLA{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-left:12px;} .hGZNLA > span{padding:10px 15px;cursor:pointer;color:#666;} .hGZNLA > span.active{color:#222;font-weight:bold;border-bottom:3px solid #f38900;}</style><style>.anchor {
      float: left;
      padding-right: 4px;
      margin-left: -20px;
    }
    h1 .anchor svg,
    h2 .anchor svg,
    h3 .anchor svg,
    h4 .anchor svg,
    h5 .anchor svg,
    h6 .anchor svg {
      visibility: hidden;
    }
    h1:hover .anchor svg,
    h2:hover .anchor svg,
    h3:hover .anchor svg,
    h4:hover .anchor svg,
    h5:hover .anchor svg,
    h6:hover .anchor svg,
    h1 .anchor:focus svg,
    h2 .anchor:focus svg,
    h3 .anchor:focus svg,
    h4 .anchor:focus svg,
    h5 .anchor:focus svg,
    h6 .anchor:focus svg {
      visibility: visible;
    }</style><script>document.addEventListener("DOMContentLoaded", function(event) {
      var hash = window.decodeURI(location.hash.replace('#', ''))
      if (hash !== '') {
        var element = document.getElementById(hash)
        if (element) {
          var offset = element.offsetTop
          // Wait for the browser to finish rendering before scrolling.
          setTimeout((function() {
            window.scrollTo(0, offset - 0)
          }), 0)
        }
      }
    })</script><style>.gatsby-resp-image-image{width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;color:transparent;}</style><link rel="preconnect dns-prefetch"href=https://www.google-analytics.com><link as=script href=/webpack-runtime-637472cda64d1aebe84f.js rel=preload><link as=script href=/app-6cf07a7abfe7f6dd6744.js rel=preload><link as=script href=/commons-c75b4e5a2a8fcb9a3c72.js rel=preload><link as=script href=/component---src-templates-sdk-index-tsx-e7be1fe26c7b5854dc70.js rel=preload><link as=fetch crossorigin href=/page-data/sdk/authentication/page-data.json rel=preload><body><noscript id=gatsby-noscript>This app works best with JavaScript enabled.</noscript><div id=___gatsby><div id=gatsby-focus-wrapper role=group style=outline:none tabindex=-1><div class="Layout__Page-sc-1mygr1y-0 gwYVmm"><div class="Header__Background-pyjs7s-0 hZKwzf"><div class="Container__StyledContainer-sc-1uo3bv1-0 cxfCUy"><div class="Header__Flex-pyjs7s-1 MHzyv"><a class="Header__LogoLink-pyjs7s-2 geCEcm"href=/> <img src=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABzNJREFUeNrsXY2VnDYQhquADkIHJh3gCkIqCB1kU0HogHTApYJNKtC5As4VcKmASwUE4sFPHutfAwJW8x5vn9cgtPPNv0a6JIkUKVKkYJRSDTRNUz5/5Ojr9zRNXyObN6KZ6Znou/mq5qubr3H6Qmy+mvkqItfomH+br1YHEDCepwWMMnLQQ+rn6z5fvcUzxXI/AuIu0qBIeub3YFpyR+B4GqJZsmf+Qo3HOB0CwRrMRwVgZdzg66zBD/DUR3Okd7gr1Q7PNwptmny16urMz7lwcnAco1xAFDjmEYGQo1C2engfgcxF7TFOj5m5jIcAaCUCUIEWVg9lqkByJx/pR2Zs0PiD0SCcbcEf1ZcHAxhGYqM5MBuBhPNUGIyVAQADhLb11aV/8g0V0Xg5+j8+PygdNGuEq7uMz0BMGYgB7dD/Va4AcBrRobC2PjPzsVnoiEPZb7QAGOgMAAJyRJn2oetOT5LvK/Tvfwje9YvsHWmavs8f3mXreZy/5o+P3FgLyOx0OYagZlN6jldM3xOTvDMjmH926uKfIEHyBaATADDhbJnC12hAOFzJ40kkrfNHRsiIxQyYOsQXqveCWfuITFsBJik7LACUzAf63eLeT5Qv5kB4PzIIicAUTBQmSBBNTbLQdksbLak7HcIcPW08vkr6cdTzGSSWnKAx4ByaQKUBKLYXUY3v3+G3HU4TTDXAxQTpnnkR2OtNidOEN6QJwZZGTQH4wWFs1Q96nZnxFuIHAwg/IgHIwByVRwDgzVSaNVLzYY9w0zU6mq9FE37j/EIWIms2BSCXVENzRW+QyqT8u6NPy2SFuRmEP0AbnvnAAfxCmBqSwnneFPfWhs589/VfCG+ZYcjcIicdpqqKFmKUJWmuzFAb1H92BYCbG7N8rsLl+F1X4ATFOGk4iur8GIReMk63I/OtAVBoxQianW09+VrCOCa5v+WZu05QsKpmtPZLYEI76kootwS6PRCaEoLMF/So2+0G48jArDaad6+Ye0e0tMr437kVCEwmvaLwU5JlrvZzNNUmj/lWkvcIfRCBRvBADOQCpZBcafoOIAyTOZVEUt9O9tRTZL8ICEba56qRqF6xQYMZMmEgkMTKAPQBQGICE1UT8WoFYiSL8jSxvLK9HDTIxCR0hCaoQwweROZGsIunJrYcI4k2wERHV5sKz98MJHTzsFSXKVNGNDDmGr6WW/oC7JxbGepcW6EMjDa5GIFZ8tcwC5tutA8MHKdIM6oLgpB5lzRQi7otEIVm7BvKNLMLg1D6qpMrtSrGogSqSS5I6x65vfyBVcSEpORSWsBFXA1JJ7cnCJMqdeeirttFmN8ITPedYuDa0Sdow841sTopw2tg+k2RnTOql9mWHYwyaS7qKk5mZnrTwIT6xS01CODwmxMBUNhEhluVrxkxCM3JzA8LBgAConPwD71Iqk4GgKkW3PeyibWlVnTJyckwQmz2nlRpAcTtAiDkEAk1kn0RTaiJmQJxqZ3xAq0ojzCh0cYfXAAEPlzPjjChTNH6Ml0lE+Z+r/NJM6G0YVQkadkJAWhkax5PISeWpulz8v0+roUWJsu0oDyxMnw6qoSIFvJHSYLWEryvgKCAv/KtNSBUSMYvtigbowRhWyO45+4IcK3xO5vZaHjvPQQApW1jFAJhkPyY0oLxjeD80nIdA+4poYJ524gPLFSXdeHSGIVAqATq3BmCP8B1C+m8gy4yaZKvUbQQj8q7spNVVKas9e1GAOFhvmHx+ltCO1hdca7W+I8MjSesHXHAeXVDo4a00Sc7F52XF8oUuYBQafYd5ALm157CwkSt9p5ghi+vSI4vNgGB4QiCO3uIIcYVvqaCusn2UA1nks0TytZ3bq9CJvhu4tZfKZhP3hBwyIUlLkIx6pgG0CqJGRoJzE5P1a4u0PrjdvuhrjjpqhH8kEZQR/I+boBrWc82EDJtuJwewSxB3efX5Nujcn6GI8i+3scfZwDPDdwz/x9DYHPkAYD6E/8caMFyyAiW3GX8l+TL8W2y49WWZz9AverPecwmOQsJFva1yYtg/4KxJIOE9gLf4tPvdP4zTBFTTf5Ch/XpJ5zdzzW1KF07PoMA4FpHKiP7nlvcyzOn1IBcSfKOUlKFzbeumh4VBJO6DzPtyl439SWRjEDoDLVAVe4YeLtMkd0+EgDZusORoNyxbtirI2ft4+nR0myZbFktiObXPAIId9OM0nLH/ApG5Tiv65zWbmBeOsv7bVvn1yXT0jBnuV+tfUarBQ7+w7V1fl1FK7mTX/Dm7i55JAL7Xjg8l1smWEaHfTxqRFR7PL/uTe49Sw2P+1edCA/WWDsh1g5mZugjquSRaWsGcKD0Nqt2EYBt3rX2+Q8RBI4pAQOAgapTIpK73/A+iTESjTYcY7dLBCFAw22kryC0W55/GsnMJ3g746fISjeCLornxPOPHkUA/Ohv3wEiAH70GgEIb4YinZn+E2AA+bSYUuLhV+4AAAAASUVORK5CYII=> <span> LoyaltyLion for Developers </span> </a><nav class="Header__Nav-pyjs7s-3 dVqVQq"><a class="Header__NavItem-pyjs7s-4 hgJSRz"href=/docs> Documentation </a><a class="Header__NavItem-pyjs7s-4 hgJSRz active"href=/sdk> SDK </a><a class="Header__NavItem-pyjs7s-4 hgJSRz"href=/api> API </a></nav></div></div></div><div class="flex Container__StyledContainer-sc-1uo3bv1-0 cxfCUy"><div class="Sidebar__SidebarContainer-q8j3dx-0 dhqwLK"><div class="Sidebar__SidebarBackground-q8j3dx-1 ewtsKs"><div class="Menu__Sticky-sc-1whidny-3 kkHgDU"><div><div class="Menu__MenuHeading-sc-1whidny-0 iZyBAR">LoyaltyLion SDK</div><ul class="Menu__MenuList-sc-1whidny-1 faZXnm"><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/> Overview </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/installation> Installation </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA active"aria-current=page href=/sdk/authentication> Authentication </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/javascript-api> JavaScript API </a></ul></div><div><div class="Menu__MenuHeading-sc-1whidny-0 iZyBAR">Simple components</div><ul class="Menu__MenuList-sc-1whidny-1 faZXnm"><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/customer-points> Customer points </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/points-for-rule> Points for rule </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/customer-referral-url> Customer referral URL </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/loyalty-widget> Loyalty Widget </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/points-for-product> Points for product </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/points-for-cart> Points for cart </a></ul></div><div><div class="Menu__MenuHeading-sc-1whidny-0 iZyBAR">Embeddable components</div><ul class="Menu__MenuList-sc-1whidny-1 faZXnm"><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/loyalty-panel> Loyalty Panel </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/rules-list> Rules list </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/rewards-list> Rewards list </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/claimed-rewards-list> Claimed rewards list </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/history-table> History table </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/tier-overview> Tier overview </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/tier-benefits-compare> Tier benefits compare </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/tier-rewards-compare> Tier rewards compare </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/tier-rules-compare> Tier rules compare </a></ul></div><div><div class="Menu__MenuHeading-sc-1whidny-0 iZyBAR">Modal components</div><ul class="Menu__MenuList-sc-1whidny-1 faZXnm"><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/referral-modal> Referral modal </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/referee-welcome-modal> Referee welcome modal </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/rule-modal> Rule modal </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/redeem-reward-modal> Redeem reward modal </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/claimed-reward-modal> Claimed reward modal </a><li><a class="Menu__MenuListItemLink-sc-1whidny-2 kzDOmA"href=/sdk/components/history-info-modal> History info modal </a></ul></div></div></div></div><div class="Sidebar__SidebarToggleButton-q8j3dx-2 hgVJGJ"></div><article class="Article-ad95cn-0 dnREIL"><h1>Authentication</h1><div><p>When a customer is logged in, the LoyaltyLion SDK needs to authenticate them in order to display their information (points, rewards) and allow them to perform actions like earning points and claiming rewards.<div class="callout blue"><p>Customer authentication is performed automatically on Shopify, BigCommerce and Magento.</div><p>Authentication in LoyaltyLion leverages your existing customer accounts so a customer doesn’t need to sign in twice or have a separate account with LoyaltyLion.<p>It works by generating a secure server-side auth token (MAC) which is passed through to LoyaltyLion on the next page load. LoyaltyLion verifies the auth token and if it checks out, will consider the customer authenticated.<h2 id=creating-the-auth-token><a aria-label="creating the auth token permalink"class=anchor href=#creating-the-auth-token> <svg viewbox="0 0 16 16"aria-hidden=true focusable=false height=16 version=1.1 width=16><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"fill-rule=evenodd></path></svg> </a> Creating the auth token</h2><p>The auth token is a <code class=language-text>
          SHA-1
         </code> hash of the following concatenated items, in order:<ul><li>the customer’s unique <code class=language-text>
           id
          </code><li>the current date, as an <code class=language-text>
           ISO 8601
          </code> timestamp<li>the customer’s email address<li><a href=https://app.loyaltylion.com/go/manage/settings target=_blank> your LoyaltyLion secret </a></ul><p>This auth token must be generated server-side, i.e. in your template. Your LoyaltyLion secret should never be exposed. The generated token can then be sent to the client and used in a call to <a href=/sdk/javascript-api#initialization> <code class=language-text>
           loyaltylion.init
          </code> </a> or <a href=/sdk/javascript-api#authentication> <code class=language-text>
           loyaltylion.authenticateCustomer
          </code> </a> to authenticate the customer.<div class="tab-group TabGroup__TabGroupDiv-bieer2-0 czwxpA"><nav class="TabGroup__TabGroupNav-bieer2-1 hGZNLA"><span class=active> Ruby </span><span> PHP </span><span> Shopify (Liquid) </span></nav><div class=tab-group-content><div class=gatsby-highlight data-language=ruby><pre class=language-ruby><code class=language-ruby>date <span class="token operator">=</span> <span class="token constant">DateTime</span><span class="token punctuation">.</span>now<span class="token punctuation">.</span>iso8601
secret <span class="token operator">=</span> <span class="token string">'YOUR_SECRET'</span>

auth_token <span class="token operator">=</span> <span class="token constant">Digest</span><span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token constant">SHA1</span><span class="token punctuation">.</span>hexdigest<span class="token punctuation">(</span>
  current_user<span class="token punctuation">.</span>id<span class="token punctuation">.</span>to_s <span class="token operator">+</span> date <span class="token operator">+</span> current_user<span class="token punctuation">.</span>email <span class="token operator">+</span> secret
<span class="token punctuation">)</span></code></pre></div></div></div></div></article></div></div></div></div><script>if(true) {
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  }
  if (typeof ga === "function") {
    ga('create', 'UA-36009571-12', 'auto', {});
      
      
      
      
      
      }</script><script id=gatsby-script-loader>/*<![CDATA[*/window.pagePath="/sdk/authentication";window.webpackCompilationHash="ce7ac197ed837dc1879d";/*]]>*/</script><script id=gatsby-chunk-mapping>/*<![CDATA[*/window.___chunkMapping={"app":["/app-6cf07a7abfe7f6dd6744.js"],"component---src-templates-api-index-tsx":["/component---src-templates-api-index-tsx-f59c5fd939e7466a6794.js"],"component---src-templates-docs-index-tsx":["/component---src-templates-docs-index-tsx-c3d622a2209b742d2a04.js"],"component---src-templates-sdk-index-tsx":["/component---src-templates-sdk-index-tsx-e7be1fe26c7b5854dc70.js"],"component---src-pages-404-tsx":["/component---src-pages-404-tsx-464fe9c7ac79a84c2c6c.js"],"component---src-pages-index-tsx":["/component---src-pages-index-tsx-bc56d77e4f169c71fe82.js"]};/*]]>*/</script><script async src=/component---src-templates-sdk-index-tsx-e7be1fe26c7b5854dc70.js></script><script async src=/commons-c75b4e5a2a8fcb9a3c72.js></script><script async src=/app-6cf07a7abfe7f6dd6744.js></script><script async src=/webpack-runtime-637472cda64d1aebe84f.js></script>