Skip to content

Bearer + token in JS not working #5

Description

@Chloe-blue

Describe the bug
Hello Arcadier,
I have an issue with JS. I used the Authentication API, got the token, and added "Bearer" before it to use to authenticate with other API's, but it keeps saying "Authorisation was denied."

To Reproduce
Steps to reproduce the behavior:
This was my code:

var get_token = {
 "url": "https://" + baseURL + "/token",
 "method": "POST",
 "headers": {
   "Content-Type": "application/x-www-form-urlencoded"
 },
 "data": {
   "client_id": "",
   "client_secret": "",
   "grant_type": "client_credentials",
   "scope": "admin"
 }
};
	
$.ajax(get_token).done(function(admin_token) {
  token = "Bearer " + admin_token.access_token;
}

What am I doing wrong?
P.S: baseURL was already declared to be = inkit.sandbox.arcadier.io

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions