How to pass username/password to REST API (WS) using JBossRestEasy client (2.3.6 jar)?


I have a REST API site requiring id/pw to connect.

I am using JBoss RestEasy 2.3.6 to consume above APIs.
It's clear to me what I need to do pass my id/pw for the authentication.
Can you help?

I thought I could pass id/pw through headers or something.
Do I need to create interceptor or filter?
Can you direct me to a example or something?
Thank you
Who is Participating?
mccarlConnect With a Mentor IT Business Systems Analyst / Software DeveloperCommented:
I have a REST API site requiring id/pw to connect
We would need more info about the above. How exactly does the remote site expect the id/pw to be presented to it? ie. is it expecting HTTP "Authentication" headers, or do you need to post the id/pw to a page and then use cookies to maintain a session, etc.
ManishConnect With a Mentor LeadCommented:
Do you have format of input required to call rest api? Is it JSON or something else?
Also you can send useid/password in header depends on  backend implementation.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.