I did download a collection and environment variables for a project i am working on. I then modified the environment variables to match my lab setup and all is working.
The authorization is set to ‘Inherit from parent’. This is fine. I went to the collection folder and the Authorization is set to ‘Bearer Token’ which is expected and the Token is set to {{bearToken}}.
Now, in the collection in the Authentication folder, i can get a token successfully and i get something like this:
The question is: how is the access_token that I get, automatically assigned to the {{bearToken}} ?
Should I see somewhere like access_token = {{bearToken}}?
In any case, when the token is expired, and i perform a request, is a new token, AUTOMATICALLY, re-fetched? Or do I start AUTOMATICALLY using the ‘refresh_token’ value? what is the difference between the two ?
How does this {{bearToken} gets translated to the Authorization Line? I guess it knows, because in the ‘Parent’ it was set to Bearer. Is this mapped automatically ?
Off the top of my head without looking, if it is “inherited from parent” I would expect that to be fed in before the request is sent. (almost like a pre-req script would be).
The fact that it is a darker grey colour (the tick boxes on the left), shows it is one of the “auto-generated headers”.
You could change it if you wanted to. The ‘Bearer’ is passed as a header regardless of where the value is initially stored. you could literally put the {{bearToken}} variable in that ‘value’ field above and it would send the same token. I find the “inherit from parent” is preferred by some people but I usually submit mine just as a header.