Looker API's api/token endpoint fails to retreive an access_token for Authentication

38 Views Asked by At

I'm having a little bit of trouble accessing the Looker API on my local web server, I'm running it on http://localhost:3000 and I'm using JavaScript (Reactto be more precise, with Node.js v18.10.0) and I'm following the steps on the official Google's documentation

In that page, the first step is to register an OAuth Id for my application, which I have done, through Google Cloud's console in this URL for OAuth Credentials. Once I do that, the next step is to generate a code_verifier, and save it in the sessionStorage, and then call their https://mycompany.looker.com/auth api, I get a code, and after that, I have to make another call to another service called **https://mycompany.looker.com/api/token** using that very same code_verifier to receive finally, an access token to make my API Calls through CORS.

In that regard, all I get when I'm trying to use the **/api/token **service, is a CORS Problem both in my local server, and in my web server on an https web site.

Web and Local Error

and when trying to access through Postman I get the next error message:

Postman Error

So, in a kind of desperate manner, I need a little assistance, trying to make the Looker API Authentication work for me, either through localhost (for fast testing) or by uploading it to my web server. All I'm getting are CORS errors.

A little bit of extra info:

  • Already Registered OAuth App
  • Already added my user to the activated_users of the OAuth App registration
  • Copied and Pasted the code from the Google Documentation page, auth works, api/token not.
  • I want to use the API for a frontend application, only to call for information on a data set.

Hopefully, you can help me find a solution!

Already tried:

  • Google's Step by Step guide for using Looker's API
  • Using Typescript instead of Javascript
  • Registering my Lookers Client ID instead of the App's OAuth ID
0

There are 0 best solutions below