Project IDX + Docker

Hello, Postman community.

I am in the process of transitioning to the development environment Project IDX from Google. Everything works, but I cannot find the optimal way to test my projects (which are naturally Rest APIs, and packaged in a Docker container) in Postman.

The issue is that Project IDX provides an external URL like some-unix-url.cloudworkstations.dev, which requires using Bearer authorization, and the token for this is taken from Project IDX.

This raises 2 questions:

  1. What should I do if my own API also requires passing an accessToken through Bearer authorization? It turns out that one token is needed for my API to function, and another for remote access to my development environment.
  2. The lifespan of the access token obtained in Project IDX is 1 hour. Do you know a way to automate its renewal/acquisition? If the token not passed, Postman’s request will return a Google authorization HTML page.

Hi @kit-dev. Welcome to the Postman Community.

  1. Postman supports the use of multiple authorization schemes that you can use to authorize your APIs. This includes Bearer tokens.

  2. Does this Authorization include an OAuth process? How is the Bearer token generated? Postman allows you to easily setup OAuth and auto refresh bearer tokens, that is if your API uses OAuth. Sharing more info here will enable me assist you better.

Thank you for the help, but it would be better if someone with experience working with Project IDX could join the discussion.

But if I am to answer your questions:

  1. How can I send 2 Bearer tokens in one request, and ensure that my API does not get confused between them? The same question applies to Project IDX.
  2. No, all that Project IDX provides is a temporary access token. It is generated using cmd+shift+p → Project IDX: Generate Access Token:

    I see no way to automate this, which is why I started this discussion.

There is what Project IDX docs says about it: https://developers.google.com/idx/guides/troubleshooting#app-backend

I do not see how 1 is possible. AFAIK, you can only ever include one “Authorization” header in an HTTP request. I am not familiar with Project IDX. Does it require you to add two “Authorization” headers?

You’ll get better help asking in a Project IDX centric community or discussion forum.

The first token is needed to access the Docker container in the Project IDX cloud environment.
The second token is required for the operation of the REST API itself to authorize the request.

And I would gladly write to the Project IDX community, but it seems that there isn’t one yet. This is too new technology, which has not yet been released in full. I’m even thinking of making a video explaining how to solve this problem if I find the solution myself.

@kit-dev, I face the same issue as yours and I changed my backend authorization header name to be able to pass 2 auths one for IDX and the other for my backend
I use nodejs for my backend so instead of getting the bearer token from the Authorization header now it’ll get it from x-firebase-token

ExtractJwt.fromHeader('x-firebase-token')

and the IDX Bearer token is passed in the default Authorization header
Screenshot 2024-05-16 at 1.46.39 PM

Have you found a way to automate obtaining an access token for the container in the Project IDX cloud?