# Axios post req to get management token works in chrome but not in firefox, Edge and safari

**URL:** <https://community.auth0.com/t/axios-post-req-to-get-management-token-works-in-chrome-but-not-in-firefox-edge-and-safari/104443>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [April 11, 2023, 10:21am UTC](https://community.auth0.com/t/axios-post-req-to-get-management-token-works-in-chrome-but-not-in-firefox-edge-and-safari/104443 "2023-04-11T10:21:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhavith.chandra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bhavith.chandra/32/42478_2.png) [@bhavith.chandra](https://community.auth0.com/u/bhavith.chandra)\
**Post date:** [April 11, 2023, 10:21am UTC](https://community.auth0.com/t/axios-post-req-to-get-management-token-works-in-chrome-but-not-in-firefox-edge-and-safari/104443/1 "2023-04-11T10:21:31Z")

</div>

Am working with react app and the below code gives me management token in chrome but not in other browsers like firefox and edge.

```auto
 const getLoggedIn = async () => {
    try {
      const response = await axios.post(
        "https:///oauth/token",
        new URLSearchParams({
          grant_type: "client_credentials",
          client_id: "xxxxxx",
          client_secret:
            "xxxx",
          code: `code`,
          redirect_uri: "https://.net/",
          audience: "https://abc/api/v2/",
          cacheLocation: "localstorage",
        }),
        {
          headers: { "content-type": "application/x-www-form-urlencoded" },
        }
      );
      console.log(response);
      localStorage.setItem("mToken", response?.data?.access_token ?? "");
    } catch (error) {
      console.log(error);
    }
  };

```

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 12, 2023, 4:27pm UTC](https://community.auth0.com/t/axios-post-req-to-get-management-token-works-in-chrome-but-not-in-firefox-edge-and-safari/104443/3 "2023-04-12T16:27:51Z")

</div>

Hi @bhavith.chandra,

Welcome to the Auth0 Community!

**This setup is completely insecure and you are leaving your Auth0 tenant open to malicious actors by publishing the client ID/secret in a browser-based application.** Any data sent to the client can be inspected by the end user and used for malicious purposes.

You should never use the client credentials grant in a client-side application (SPA, native app, etc.). Additionally, [browser based flows are very limited in scopes with the Management API](https://auth0.com/docs/secure/tokens/access-tokens/get-management-api-tokens-for-single-page-applications) and should be avoided.

I would suggest starting with our [quickstarts](https://auth0.com/docs/quickstarts).

Let me know if you have any questions.

---

<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:** [April 26, 2023, 4:28pm UTC](https://community.auth0.com/t/axios-post-req-to-get-management-token-works-in-chrome-but-not-in-firefox-edge-and-safari/104443/4 "2023-04-26T16:28:14Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
