# renewAuth errors

**URL:** <https://community.auth0.com/t/renewauth-errors/7282>\
**Category:** Get Help\
**Tags:** renewauth\
**Created:** [June 27, 2017, 3:03pm UTC](https://community.auth0.com/t/renewauth-errors/7282 "2017-06-27T15:03:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![evan.siroky](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@evan.siroky](https://community.auth0.com/u/evan.siroky)\
**Post date:** [June 27, 2017, 3:03pm UTC](https://community.auth0.com/t/renewauth-errors/7282/1 "2017-06-27T15:03:58Z")

</div>

I’m using the code from this PR: [Add option to filter iframe events to prevent incorrect events triggering callbacks by aaronchilcott · Pull Request #432 · auth0/auth0.js · GitHub](https://github.com/auth0/auth0.js/pull/432) and am trying to renew a users idToken. Here is my relevant code:

```
const auth0 = require('auth0-js')

const auth0client = new auth0.WebAuth({
  domain: process.env.AUTH0_DOMAIN,
  clientID: process.env.AUTH0_CLIENT_ID
})

auth0client.renewAuth({
    audience: '',
    postMessageDataType: 'auth0:silent-authentication',
    redirectUri: window.location.origin + '/auth/silent-callback',
    scope: 'openid app_metadata user_metadata',
    usePostMessage: true
  }, (err, authResult) => {
    if (err) {
      console.log('Failed to renew log in.')
      return callback(err)
    }

```

And here is the jade file that is used to render /auth/silent-callback:

```
doctype html
html(lang='en')
  head
    script(type='text/javascript').
      var data = {
        type: 'auth0:silent-authentication',
        hash: window.location.hash
      };
      
      // This page is designed to be loaded in an Iframe
      var result = parent.postMessage(data, "*");

  body

```

However, I was first getting the error: “Algorithm HS256 is not supported. (Expected algs: [RS256])”. So I went and changed the algorithm to RS256, but then I got the error: “Nonce does not match.”

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![evan.siroky](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@evan.siroky](https://community.auth0.com/u/evan.siroky)\
**Post date:** [June 29, 2017, 1:20am UTC](https://community.auth0.com/t/renewauth-errors/7282/2 "2017-06-29T01:20:57Z")

</div>

Looks like I had to include a nonce in the renewAuth method when using RS256.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:54am UTC](https://community.auth0.com/t/renewauth-errors/7282/3 "2018-03-02T05:54:59Z")

</div>


