Hello All, Can any one please explain, how to add ...
# help
p
Hello All, Can any one please explain, how to add dynamic bearer token in the authorization section? I coud see basic authorization in place in the documentation, does the bearer token works same way? if it is similar to that, how it can be dynamic, with jsonpath? Regards, Prasenjit
b
What is it exactly that you're looking for? You want to check that an incoming request has an
Authorization
header with a value that matches
Bearer <anything>
, basically? This shouldn't be too hard with a RequestFilter.
p
basically wanted to use authoriztion type as bearer token and ten value would be user input
b
I don’t understand the question. Can you give me an example? The token is sent in the request, that’s the responsibility of the consumer. You’re mocking the provider, so you’re not responsible for creating the token, unless you’re mocking the authentication server?
p
Hello Bas, You got it correct, first of all, is authorization the request with bearer token possible in mock? if so, how can it be done? is it the same way as the basic authorization shown in the documentation? Regards,
Well changing my question a bit, I did few hit and trial and looks like authorization doesn't have any impact of the wiremock response till all the headers, urlpath and body data is matching...is that correct understanding? @Oleg Nenashev @Bas Dijkstra
o
It depends on your configuration. But yes, if there is no token being checked in request filters, the response will be the same
1
p
@Oleg Nenashev, thanks for the reply, but I am not able to understand how this Authorizaion (Bearer token) will be checked in the request filter? Can you explain a bit please with an example please