-
Notifications
You must be signed in to change notification settings - Fork 528
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
How to reuse the login logic #2110
Comments
I've been facing this same issue. A more generic solution would be creating the ability to call a Hurl file within a Hurl file. users.hurl
auth.hurl
|
I would also like to hurl to implement something like that. For now I created a tool only for that, https://github.com/SilenLoc/aditus, it only works with Auth0 or equal token endpoints with pw flow. (not everything in the wild is OIDC compliant) Obvs. you can use pure curl, take the token with jq from the response, then assign it to HURL_access_token={{token}} I made and will continue to improve the tool to integrate with Hurl. For now it supports creating a env file with = and returning the token raw or the whole answer. |
I think it's great. |
This seems like a natural use case for the intended purpose of this tool, and the flow described of including files is a reasonable method of composition. But either way, definitely need some support for this login workflow in order to use this tool. |
I was looking for a way to test different tokens for different request parameters. I could reuse variables in the following way. Hope it helps: token.hurl
|
I suggest to add a
That would be resolved so that every place with that pastes the pointed file inside. |
Problem to solve
In order to query most API's one has to perform authorisation, e.g.:
Now either one must copy and paste it at the top of all the related hurl files, or there needs to be a way to share the
access_token
variable between calls, e.g.hurl --variable username=bob login.hurl need_token_here.hurl
Proposal
I have being going through the docs and can't figure out how to, maybe somethings already exists, if not might be great to update the FAQ to help new commers. If no way exists, maybe one could export the variable to the hurl runner which passes them into the next session?
The text was updated successfully, but these errors were encountered: