Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
7 subscribers
Views
1674 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
I have exposed a data store entity (and thus, a database table) using Web APIs.
mayankk718
over 8 years ago
I have exposed a data store entity (and thus, a database table) using Web APIs. I got a URL which gives me a JSON exposing the data of the entire database table.
When I am logged in to that environment, and try to hit the URL in the same browser, it gives me the JSON. But, when I am logged out, it says "page can't be displayed". I thought the URL would ask me credentials, but instead, it is not giving anything.
My use case is, I want to hit the URL and get the JSON response using Java code, which I have toi write. What I think is, prior to that, I need to login into my environment using Java code, and after that I'll hit the URL using Java code and get the JSON response.
I have used several SOAP/HTTP related APIs in the past but have never faces any case like this. Generally when I hit a URL with security, it either asks me for credentials, or I have to give credentials in the message header, or in the message body, but here I am confused, as thi...
OriginalPostID-159558
OriginalPostID-159558
Discussion posts and replies are publicly visible
Parents
0
matt.flanagan
Appian Employee
over 8 years ago
For Web APIs we use preemptive basic authentication, meaning that we don't ever prompt for credentials you don't provide them. You need to send the credentials along with your initial request.
If you're using Apache's HTTP Client to make your request from Java, you can set client.getParams().setAuthenticationPreemptive(true) to turn this on.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
matt.flanagan
Appian Employee
over 8 years ago
For Web APIs we use preemptive basic authentication, meaning that we don't ever prompt for credentials you don't provide them. You need to send the credentials along with your initial request.
If you're using Apache's HTTP Client to make your request from Java, you can set client.getParams().setAuthenticationPreemptive(true) to turn this on.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data