Reputation: 863
I have a JSON file which I have in maven artifactory.
I need to put the URL in another web application which would directly point to this JSON file. But then the issue I am facing is, due to the authentication issue, it is not able to read it.
So is it possible to specify the credentials directly in the URL so that we can avoid the authentication issue and the other web application could read the JSON file directly.
The web application needs the URL which would return a JSON file.
Upvotes: 1
Views: 2256
Reputation: 1406
I'm not a Maven expert, but you can add the credentials in the URL. In the sample below I've used curl to show how that would work.
For example, this curl command would upload a file (download would work the same, just without the -T <MyFileName>
)
curl -uadmin:<PASSWORD> -T <MyFileName> "http://jfrog.local/artifactory/generic-local/bla"
If I want to add the credentials into the URL I'd end up with
curl -T <MyFileName> "http://admin:<PASSWORD>@jfrog.local/artifactory/generic-local/bla"
Both curl commands do the the same, the difference is where I have the credentials.
Upvotes: 2