Skip to content
Permalink
Browse files
[JENKINS-47448] Make JDKInstaller work for old login site as well (#3136
)

* Fix JDKInstaller to work with old and new Oracle login flow

* Update Javadoc to explain that both login flows are supported

(cherry picked from commit 5c1fd7d)
  • Loading branch information
dwnusbaum authored and olivergondza committed Nov 22, 2017
1 parent c624f66 commit 823b51f0baf35de539886f4259a482e33684b19a
Showing 1 changed file with 10 additions and 5 deletions.
@@ -477,17 +477,22 @@ public URL locate(TaskListener log, Platform platform, CPU cpu) throws IOExcepti
throw new IOException("Failed to request " + m.getURI() +" exit code="+r);

if (m.getURI().getHost().equals("login.oracle.com")) {
/* Login flow:
/* Oracle switched from old to new, and then back to old. This code should work for either.
* Old Login flow:
* 1. /mysso/signon.jsp: Form for username + password: Submit actions is:
* 2. /oam/server/sso/auth_cred_submit: Returns a 302 to:
* 3. https://edelivery.oracle.com/osso_login_success: Returns a 302 to the download.
* New Login flow:
* 1. /oaam_server/oamLoginPage.jsp: Form for username + password. Submit action is:
* 2. /oaam_server/login.do: Returns a 302 to:
* 3. /oaam_server/loginAuth.do: After 2 seconds, JS sets window.location to:
* 4. /oaam_server/authJump.do: Contains a single form with hidden inputs and JS that submits the form to:
* 5. /oam/server/dap/cred_submit: Returns a 302 to:
* 6. https://edelivery.oracle.com/osso_login_success: Returns a 302 to the download.
*/
if (m.getURI().getPath().contains("/loginAuth.do")) { // You are redirected to this page immediately after logging in.
if (m.getURI().getPath().contains("/loginAuth.do")) {
try {
Thread.sleep(2000); // Oracle website waits 2 seconds after logging in before redirecting.
Thread.sleep(2000);
m.releaseConnection();
m = new GetMethod(new URI(m.getURI(), "/oaam_server/authJump.do?jump=false", true).toString());
continue;
@@ -523,9 +528,9 @@ public URL locate(TaskListener log, Platform platform, CPU cpu) throws IOExcepti
String n = extractAttribute(fragment,"name");
String v = extractAttribute(fragment,"value");
if (n==null || v==null) continue;
if (n.equals("userid"))
if (n.equals("userid") || n.equals("ssousername"))
v = u;
if (n.equals("pass")) {
if (n.equals("pass") || n.equals("password")) {
v = p.getPlainText();
if (authCount++ > 3) {
log.hyperlink(getCredentialPageUrl(),"Your Oracle account doesn't appear valid. Please specify a valid username/password\n");

0 comments on commit 823b51f

Please sign in to comment.