# Using renewAuth fails with unsupported response mode

**URL:** <https://community.auth0.com/t/using-renewauth-fails-with-unsupported-response-mode/7266>\
**Category:** Get Help\
**Tags:** silent-auth, silent-authenticatio\
**Created:** [June 26, 2017, 5:41pm UTC](https://community.auth0.com/t/using-renewauth-fails-with-unsupported-response-mode/7266 "2017-06-26T17:41:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijay.patel](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@vijay.patel](https://community.auth0.com/u/vijay.patel)\
**Post date:** [June 26, 2017, 5:41pm UTC](https://community.auth0.com/t/using-renewauth-fails-with-unsupported-response-mode/7266/1 "2017-06-26T17:41:02Z")

</div>

We are attempting silent login as follows:

```
webAuth.renewAuth({
                    domain: '<org>.auth0.com',
                    redirectUri: '<domain>/auth0/callback',
                    responseType: 'code',
                    usePostMessage: true
                }, function (err, authResult) {
                    console.log(err);
                    console.log(authResult)
                });

```

However we are getting an 501 error:

```
unsupported_response_mode: fragment.

```

I’m authenticated using SSO Auth0 to Google auth. And want to use the above to check if I can renew auth i.e. there is an SSO session in Auth0 that I can reuse.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [June 26, 2017, 9:13pm UTC](https://community.auth0.com/t/using-renewauth-fails-with-unsupported-response-mode/7266/2 "2017-06-26T21:13:04Z")

</div>

The `renewAuth` method uses defaults for some of the options that you don’t explicitly pass. Of particular importance for this situation is that it uses a default of `fragment`for the `responseMode` parameter and a value of `token` for the `responseType` parameter.

Using `token` with `fragment` is supported as so it would be using `id_token token` with `fragment`. **However, using `responseType: 'code'` is not compatible with the default response mode of `fragment`** so you’ll need to pass a suitable response mode for that type of response; a supported one would be `responseMode: 'query'`.

Have in mind that the sample silent callback page [available in the documentation](https://auth0.com/docs/libraries/auth0js/v8#using-renewauth-to-acquire-new-tokens) is meant to be used with a response that is delivered through the fragment so if you want to go beyond that you need to also update the silent callback to handle the response accordingly. In this case, using `code` with `query` it would generally indicate that the server-side component of the callback page would process the code response, exchange it with tokens and then deliver a payload that would communicate those tokens to the parent window through post message. However, this is more work than just using a response type that immediately delivers the tokens in the fragment of the initial response so you may want to consider if you really need to be using `code` as the response type in the first place.

---

<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/using-renewauth-fails-with-unsupported-response-mode/7266/3 "2018-03-02T05:54:58Z")

</div>


