auth token generation in IntelliJ http client


We have a custom intranet endpoint to generate auth token for all of our services. So to use http client we always have to write two api one to generate token and using that token to call second api for actual functionality.

is there a way I can call token api in pre request script to avoid duplicating the token call all the time. 

we cannot store token in variable as userid or scope will be different for each api


It is possible for OAuth2 since the recent EAP builds. Please see

EAP version can be downloaded from 

If it is some kind of custom auth protocol, then I afraid it is not possible right now. There is an issue about mechanism that can achieve such behavior:


Thanks Egor Klepikov  voted for this functionality as this is very critical to make our automation solution using http client cli cleaner.