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:
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.
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.
Postman supports the use of multiple authorization schemes that you can use to authorize your APIs. This includes Bearer tokens.
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.
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