<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
<div dir="ltr"></div>
<div dir="ltr">Hi Alan,</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">The code is completely unchanged between JDK21 and JDK22; it is using virtual threads and StructuredTaskScope in both cases (and also, via a different path, platform threads in both cases).</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">I should perhaps have given a bit more background about why I think that the crypto classes are at fault. The UserSRP auth class I linked to sends a message to AWS (via an AWS API, ultimately made as an HTTP call) which includes some information
about the user. Amazon’s server responds (over HTTP) with a “challenge” which includes some pieces of information. Using those pieces of information plus knowledge of the password, the class I linked to derives an answer to the challenge, which is then sent
(via HTTP) to AWS. AWS can verify that the response could only have been generated by someone with knowledge of the password, and they will respond with a valid bearer token, which can be used as an authorization header to HTTP calls (to our internal services,
which can validate the bearer token). In this way, our services can communicate between themselves without any passwords ever being transmitted anywhere. In the following diagram, the arrows represent HTTP request/responses between us and AWS</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"> Us —-> (info) —> AWS</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"> Us <—- (challenge) <—- AWS</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"> Us —> (answer) —> AWS</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"> Us <— (bearer token | wrong user/pwd) <—- AWS</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">“Wrong username or password” indicates that the response calculated by the linked class is not correct.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">I don’t believe (though I’m not an expert, so could be wrong) that this has anything to do with javax.security APIs</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Chris </div>
<div dir="ltr"><br>
<blockquote type="cite">On 2 May 2024, at 19:59, Alan Bateman <Alan.Bateman@oracle.com> wrote:<br>
<br>
</blockquote>
</div>
<blockquote type="cite">
<div dir="ltr"> <br>
<br>
<div class="moz-cite-prefix">On 02/05/2024 19:33, Chris Marshall wrote:<br>
</div>
<blockquote type="cite" cite="mid:CWLP123MB603584D640B35C61E581766C8D182@CWLP123MB6035.GBRP123.PROD.OUTLOOK.COM">
:
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Last week I upgraded the application to be compiled by JDK22, and run on JDK22. Immediately, we started to see failures from within the User-SRP auth code
<i>only when it was run on a virtual thread from within a StructuredTaskScope.</i> The failures are merely that the code appears to have calculated the wrong authentication response (i.e. AWS Cognito returns a message to the effect that we have the wrong username
or password). It is not possible that this could be the case, because the same application, using the same username/password combo is able to successfully authenticate to AWS Cognito using User-SRP auth from a platform thread.</div>
<br>
</blockquote>
Thanks for reporting a potential issue.<br>
<br>
You say that the code was running correctly on JDK 21. Was this in the context of virtual threads and using StructuredTaskScope? I'm trying to understand from your mail if you were using virtual threads with JDK 21 and whether you were using StructuredTaskScope
in JDK 21 too.<br>
<br>
"wrong username or password" hints that maybe this is some kinda of inheritance issue, I'm specifically thinking of the inherit access control context. Would it be possible to search the code and libraries that are in use here to see if they are using the javax.security.auth.Subject
API? It's just a wild guess at this point but I think might give some clues as to where inheritance might be coming from.<br>
<br>
-Alan<br>
<br>
<br>
</div>
</blockquote>
</body>
</html>