Re: [Axis2] - Use oauth 2.0 when making a Soap Request

robertlazarski <[email protected]> Tue, 8 Aug 2023 14:47:29 -1000
Newsgroups gmane.text.xml.axis.user
Message-ID <CABpPLBXOVkhWnrN67xOUD5tayqCdNC5BWoz-E6cKuqEvWyCxnQ@mail.gmail.com>
--000000000000b194f7060272d33a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Axis 2 1.7.9 and Rampart 1.7.1 are very old and a difficult combo.

Rampart is going through a very major refactoring right now, including
upgrading OpenSAML and WSS4J to the latest. See RAMPART-449. See the github
Rampart repo to follow along. Right now the focus is fixing the unit tests.

Any type of Bearer auth requires code to get the token out of the header,
and the only place in Rampart I see that is in the SAML code.

If you can show us a sample payload, and show us the error in the logs that
you receive, it is possible that we could get these features to work -
however this is open source and it is likely we will need help to get
Rampart to fulfill the requirement you have.

On Tue, Aug 8, 2023 at 9:23=E2=80=AFAM Brian Bertram
<[email protected]> wrote:

> We are currently leveraging axis2 release 1.7.9 and rampart 1.7.1 to help
> with making soap calls.  We have working code that uses basic
> authentication (username/password).
>
>
>
> We are trying to update our program to use oAuth 2.0 instead of
> username:password.  We have it setup in the endpoint and we have the Clie=
nt
> Id, Client Secret and Refresh Token.  We updated the java code to remove
> the username:password from being set and added a Property for
> HEADER_AUTHORIZATION with Bearer <access token we got back using the Clie=
nt
> Id, Client Secret and Refresh Token>.  No changes were made to the
> axis2.xml and policy.xml files.
>
>
>
> If we run the java program the response back is an invalid username and
> password error.  If we take the access token and the Soap request that wa=
s
> created from the running of the program, which hits the invalid username =
or
> password error, and run it in SOAPUI and/or Postman the responses come ba=
ck
> successfully and with data as we would expect.
>
>
>
> So I had a few Questions that I am not finding in the documentation.
>
> Are the axis2.xml and/or policy.xml files needed for oauth?
>
> If yes then are there updates needed to the axis2.xml and/or policy.xml t=
o
> get oauth to work?
>
> Are there other updates needed to the java code besides for setting the
> Header Authorization to have a value of Bearer <access token we got back
> using the Client Id, Client Secret and Refresh Token>?
>
>
>
> *Thank you for the help*
>
>
>

--000000000000b194f7060272d33a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Axis 2 1.7.9 and Rampart 1.7.1 are very old and a dif=
ficult combo. <br></div><div><br></div><div>Rampart is going through a very=
 major refactoring right now, including upgrading OpenSAML and WSS4J to the=
 latest. See RAMPART-449. See the github Rampart repo to follow along. Righ=
t now the focus is fixing the unit tests. <br></div><div><br></div><div>Any=
 type of Bearer auth requires code to get the token out of the header, and =
the only place in Rampart I see that is in the SAML code.=C2=A0 <br></div><=
div><br></div><div>If you can show us a sample payload, and show us the err=
or in the logs that you receive, it is possible that we could get these fea=
tures to work - however this is open source and it is likely we will need h=
elp to get Rampart to fulfill the requirement you have.=C2=A0 <br></div></d=
iv><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On =
Tue, Aug 8, 2023 at 9:23=E2=80=AFAM Brian Bertram &lt;brian.bertram@alight.=
com.invalid&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex"><div>





<div lang=3D"EN-US">
<div>
<p style=3D"margin:0in">We are currently leveraging axis2 release 1.7.9 and=
 rampart 1.7.1 to help with making soap calls.=C2=A0 We have working code t=
hat uses basic authentication (username/password).<u></u><u></u></p>
<p style=3D"margin-right:0in;margin-bottom:0in;margin-left:27pt">
<u></u>=C2=A0<u></u></p>
<p style=3D"margin:0in">We are trying to update our program to use oAuth 2.=
0 instead of username:password.=C2=A0 We have it setup in the endpoint and =
we have the Client Id, Client Secret and Refresh Token.=C2=A0 We updated th=
e java code to remove the username:password
 from being set and added a Property for HEADER_AUTHORIZATION with Bearer &=
lt;access token we got back using the Client Id, Client Secret and Refresh =
Token&gt;.=C2=A0 No changes were made to the axis2.xml and policy.xml files=
.<u></u><u></u></p>
<p style=3D"margin:0in">=C2=A0<u></u><u></u></p>
<p style=3D"margin:0in">If we run the java program the response back is an =
invalid username and password error.=C2=A0 If we take the access token and =
the Soap request that was created from the running of the program, which hi=
ts the invalid username or password error,
 and run it in SOAPUI and/or Postman the responses come back successfully a=
nd with data as we would expect.<u></u><u></u></p>
<p style=3D"margin:0in"><u></u>=C2=A0<u></u></p>
<p style=3D"margin:0in">So I had a few Questions that I am not finding in t=
he documentation.<u></u><u></u></p>
<p style=3D"margin:0in">Are the axis2.xml and/or policy.xml files needed fo=
r oauth?
<u></u><u></u></p>
<p style=3D"margin:0in">If yes then are there updates needed to the axis2.x=
ml and/or policy.xml to get oauth to work?=C2=A0
<u></u><u></u></p>
<p style=3D"margin:0in">Are there other updates needed to the java code bes=
ides for setting the Header Authorization to have a value of Bearer &lt;acc=
ess token we got back using the Client Id, Client Secret and Refresh Token&=
gt;?<u></u><u></u></p>
<p class=3D"MsoNormal"><b><span style=3D"font-size:8pt;font-family:&quot;Ar=
ial&quot;,sans-serif;color:black"><u></u>=C2=A0<u></u></span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"font-size:8pt;font-family:&quot;Ar=
ial&quot;,sans-serif;color:black">Thank you for the help</span></b><u></u><=
u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
</div>
</div>

</div></blockquote></div>

--000000000000b194f7060272d33a--