-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for Bearer Token support in httpAuth() #175
Comments
Great! thank you for asking for this! :) Since this is not something the JMeter Auth Manager already supports (I guess due to The usual way to solve this in JMeter is adding http headers manually, which you can do with DSL with I will open for discussion how can we further simplify this, so anyone can take part of the decision. Some optionshttpAuth.bearerAuthI think bearer token, taking into consideration already supported basic auth, could be expressed with something like this: httpAuth()
.bearerAuth("https://myservice.com", "myToken") Implementation optionshidden HTTP Header ManagerDSL adds a HTTP header manager setting the token
JSR223 pre & post processorDSL adds JSR223 pre processor which checks sampler URL and adds header manager (or modifies existing one) to sampler on the fly.
Extend JMeter & httpClient Authentication
httpHeaders & httpSampler new methodJust add an auxiliary method to existing httpHeaders & sampler which allows to easily set auth token. Eg: httpHeaders()
.bearerAuth("myToken")
Not implement new logicJust keep with existing JMeter option of using
** Anyone has any thoughts? Any other ideas? Comments? Pros & Cons? ** |
My personal preferred solution would be some sort of httpAuth()
.bearerAuth("https://myservice.com", "myToken") and httpHeaders()
.bearerAuth("myToken") Is it just a matter of scope limitation where in the former the token is limited to |
Hello, thank you for taking the time to review the ideas and give some feedback. Yes, the difference between the first one and the second one, is that the first one should apply only to urls that start with given URL. Why do you say it looks like enhanced functionality beyond what If we think the first one should be preferred, so far I think the best approach, considering pros/cons is adding jsr223Pre & post processors with a note on the DSL method stating that Any thoughts @kirillyu , @andy-tarr , or anyone else? |
I tend to agree with you on this. |
I think that I was mixing |
Per the user guide:
The scenario I need is Bearer Token, so I'm posting an issue in the repository to let you know I need it 😀
The text was updated successfully, but these errors were encountered: