Bug 999803 - [origin_runtime_186] Return "HTTP/1.1 302 Moved Temporarily" when login aerogear push server
Summary: [origin_runtime_186] Return "HTTP/1.1 302 Moved Temporarily" when login aerog...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Farah Juma
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-22 07:34 UTC by Yan Du
Modified: 2015-05-14 23:26 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-19 16:47:37 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Yan Du 2013-08-22 07:34:16 UTC
Description of problem:

Use below commands to login server or update the password, got "HTTP/1.1 302 Moved Temporarily" back.

1) Login: curl -v -b cookies.txt -c cookies.txt
-H "Accept: application/json" -H "Content-type: application/json"
-X POST -d '{"loginName": "admin", "password":"123"}'
$app-url/rest/auth/login

2) Update the password : curl -v -b cookies.txt -c cookies.txt
-H "Accept: application/json" -H "Content-type: application/json"
-X PUT -d '{"loginName": "admin", "password":"123", "newPassword":"SOMENEWPASSWORD"}'
$app-url/rest/auth/update


Version-Release number of selected component (if applicable):
devenv_stage_448


How reproducible:
Always


Steps to Reproduce:

1. Add aerogear instant app in website quickstart
2. Deploy an aerogear push server app 
3. Login the aerogear push server 

    curl -v -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"loginName": "admin", "password":"123"}' http://push1-111.dev.rhcloud.com/ag-push/rest/auth/login

4. Update the password:

   curl -v -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"loginName": "admin", "password":"123", "newPassword":"111"}' http://push1-111.dev.rhcloud.com/rest/auth/update



Actual results:
got "HTTP/1.1 302 Moved Temporarily"

step3: Login server

[root@ip-10-144-69-180 ~]# curl -v -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"loginName": "admin", "password":"123"}' http://push1-111.dev.rhcloud.com/ag-push/rest/auth/login
* About to connect() to push1-111.dev.rhcloud.com port 80 (#0)
*   Trying 10.144.69.180... connected
* Connected to push1-111.dev.rhcloud.com (10.144.69.180) port 80 (#0)
> POST /ag-push/rest/auth/login HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: push1-111.dev.rhcloud.com
> Accept: application/json
> Content-type: application/json
> Content-Length: 40
> 
< HTTP/1.1 302 Moved Temporarily
< Date: Thu, 22 Aug 2013 06:00:27 GMT
< Server: Apache-Coyote/1.1
< Location: https://push1-111.dev.rhcloud.com/ag-push/rest/auth/login
< Content-Length: 0
< Vary: Accept-Encoding,User-Agent
< ProxyTime: D=1014659
< Content-Type: text/plain; charset=UTF-8
< 
* Connection #0 to host push1-111.dev.rhcloud.com left intact
* Closing connection #0



step4: Update password

[root@ip-10-144-69-180 ~]# curl -v -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"loginName": "admin", "password":"123", "newPassword":"111"}' http://push1-111.dev.rhcloud.com/rest/auth/update
* About to connect() to push1-111.dev.rhcloud.com port 80 (#0)
*   Trying 10.144.69.180... connected
* Connected to push1-111.dev.rhcloud.com (10.144.69.180) port 80 (#0)
> PUT /rest/auth/update HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: push1-111.dev.rhcloud.com
> Accept: application/json
> Content-type: application/json
> Content-Length: 61
> 
< HTTP/1.1 302 Moved Temporarily
< Date: Thu, 22 Aug 2013 06:00:41 GMT
< Server: Apache-Coyote/1.1
< Location: https://push1-111.dev.rhcloud.com/rest/auth/update
< Content-Length: 0
< Vary: Accept-Encoding,User-Agent
< ProxyTime: D=7016
< Content-Type: text/plain; charset=UTF-8
< 
* Connection #0 to host push1-111.dev.rhcloud.com left intact
* Closing connection #0



Expected results:

step3: Show "HTTP/1.1 403 Forbidden" 
step4: Show "HTTP/1.1 200 OK" 


Additional info:
issue can be reproduced when using CLI to create aerogear push app on fork_ami_809.

Comment 1 Daniel Bevenius 2013-08-29 13:57:42 UTC
I think this error is due to that https now enforced for the UnifiedPush Server. This was not documented for 0.8.0 but this has now been now:
https://github.com/aerogear/aerogear-unifiedpush-server#https

Could you try this again with the using SSLv3 as described above and let us know if this is still an issue?

Thanks,

/Dan

Comment 2 Yan Du 2013-08-30 09:43:21 UTC
Hi, Daniel

test on fork_ami_809, still got the same error (HTTP/1.1 302 Moved Temporarily)when using SSLv3, you can check detail info as below:
BTW,we can login/update password successfully in UI page.

1. Login:

[root@ip-10-164-15-246 ~]# curl -v -3 -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"loginName": "admin", "password":"123"}' http://push1-ccc.dev.rhcloud.com/rest/auth/login
* About to connect() to push1-ccc.dev.rhcloud.com port 80 (#0)
*   Trying 10.164.15.246... connected
* Connected to push1-ccc.dev.rhcloud.com (10.164.15.246) port 80 (#0)
> POST /rest/auth/login HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: push1-ccc.dev.rhcloud.com
> Accept: application/json
> Content-type: application/json
> Content-Length: 40
> 
< HTTP/1.1 302 Moved Temporarily
< Date: Fri, 30 Aug 2013 09:29:02 GMT
< Server: Apache-Coyote/1.1
< Location: https://push1-ccc.dev.rhcloud.com/rest/auth/login
< Content-Length: 0
< Vary: Accept-Encoding,User-Agent
< ProxyTime: D=9784
< Content-Type: text/plain; charset=UTF-8
< 
* Connection #0 to host push1-ccc.dev.rhcloud.com left intact
* Closing connection #0


2. update password:

[root@ip-10-164-15-246 ~]# curl -3 -v -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"loginName": "admin", "password":"123", "newPassword":"111"}' http://push1-ccc.dev.rhcloud.com/rest/auth/update
* About to connect() to push1-ccc.dev.rhcloud.com port 80 (#0)
*   Trying 10.164.15.246... connected
* Connected to push1-ccc.dev.rhcloud.com (10.164.15.246) port 80 (#0)
> PUT /rest/auth/update HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: push1-ccc.dev.rhcloud.com
> Accept: application/json
> Content-type: application/json
> Content-Length: 61
> 
< HTTP/1.1 302 Moved Temporarily
< Date: Fri, 30 Aug 2013 09:29:43 GMT
< Server: Apache-Coyote/1.1
< Location: https://push1-ccc.dev.rhcloud.com/rest/auth/update
< Content-Length: 0
< Vary: Accept-Encoding,User-Agent
< ProxyTime: D=6982
< Content-Type: text/plain; charset=UTF-8
< 
* Connection #0 to host push1-ccc.dev.rhcloud.com left intact
* Closing connection #0

Comment 3 Daniel Bevenius 2013-08-30 09:57:11 UTC
Hi Yan, 

could you try the same curl commands but use https instead of http? For example,  https://push1-ccc.dev.rhcloud.com/rest/auth/login

Comment 4 Yan Du 2013-08-30 10:43:08 UTC
Hi, Daniel, it works when using https instead of http. Thanks :)


1).Login (return HTTP/1.1 403 Forbidden)

[root@ip-10-84-255-128 ~]#  curl -k -v -3 -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"loginName": "admin", "password":"123"}' https://push1-ccc.dev.rhcloud.com/rest/auth/login
* About to connect() to push1-ccc.dev.rhcloud.com port 443 (#0)
*   Trying 10.84.255.128... connected
* Connected to push1-ccc.dev.rhcloud.com (10.84.255.128) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* skipping SSL peer certificate verification
* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
* 	subject: E=root@ip-10-167-10-15,CN=ip-10-167-10-15,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=--
* 	start date: Aug 18 04:35:37 2013 GMT
* 	expire date: Aug 18 04:35:37 2014 GMT
* 	common name: ip-10-167-10-15
* 	issuer: E=root@ip-10-167-10-15,CN=ip-10-167-10-15,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=--
> POST /rest/auth/login HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: push1-ccc.dev.rhcloud.com
> Accept: application/json
> Content-type: application/json
> Content-Length: 40
> 
< HTTP/1.1 403 Forbidden
< Date: Fri, 30 Aug 2013 10:37:10 GMT
< Server: Apache-Coyote/1.1
< Content-Type: application/json
< Content-Length: 22
< Vary: Accept-Encoding,User-Agent
< ProxyTime: D=1832841
< 
* Connection #0 to host push1-ccc.dev.rhcloud.com left intact
* Closing connection #0
Credential has expired[root@ip-10-84-255-128 ~]# 

2) Update password  (return HTTP/1.1 200 OK )
[root@ip-10-84-255-128 ~]# curl -3 -k -v -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"loginName": "admin", "password":"123", "newPassword":"111"}' https://push1-ccc.dev.rhcloud.com/rest/auth/update
* About to connect() to push1-ccc.dev.rhcloud.com port 443 (#0)
*   Trying 10.84.255.128... connected
* Connected to push1-ccc.dev.rhcloud.com (10.84.255.128) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* skipping SSL peer certificate verification
* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
* 	subject: E=root@ip-10-167-10-15,CN=ip-10-167-10-15,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=--
* 	start date: Aug 18 04:35:37 2013 GMT
* 	expire date: Aug 18 04:35:37 2014 GMT
* 	common name: ip-10-167-10-15
* 	issuer: E=root@ip-10-167-10-15,CN=ip-10-167-10-15,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=--
> PUT /rest/auth/update HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: push1-ccc.dev.rhcloud.com
> Accept: application/json
> Content-type: application/json
> Content-Length: 61
> 
< HTTP/1.1 200 OK
< Date: Fri, 30 Aug 2013 10:38:12 GMT
< Server: Apache-Coyote/1.1
< Content-Length: 0
< Vary: Accept-Encoding,User-Agent
< ProxyTime: D=114396
< Content-Type: text/plain; charset=UTF-8
< 
* Connection #0 to host push1-ccc.dev.rhcloud.com left intact
* Closing connection #0


Note You need to log in before you can comment on or make changes to this bug.