Login by azure Microsoft something not work on ipad/iphone - angularjs

I’m working on a website which is deployed kén azure and login through azure microsoft. However, it only works on login website on computer. Whenever I login to the website by some account ( on an ipad or an iphone, it turns to signin-oidc (error 500) and then I cannot access to home page or the other pages . Anybody face to this problem and is there any solution for this? Thanks
Go to my website -> login -> azure microsoft login page open -> login by azure microsoft -> return token from azure microsoft to client -> my website check access this token -> ....
Here is the content of the BeginAuth:
Summary
URL: https://login.microsoftonline.com/common/SAS/BeginAuth
Status: 200 OK
Source: Network
Address: *******
Initiator:
AjaxHandlerControl.js:110
Request
POST /common/SAS/BeginAuth HTTP/1.1
Content-Type: application/json; charset=UTF-8
Accept: application/json
Accept-Language: vi-vn
Accept-Encoding: br, gzip, deflate
Origin: https://login.microsoftonline.com
User-Agent: Mozilla/5.0 (iPad; CPU OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1
Referer: https://login.microsoftonline.com/
Content-Length: 2220
Connection: keep-alive
Cookie: ESTSAUTH=AQABAAQAAABeAFzDwllzTYGDLh_qYbH8o3IjKkzc2x1r88yy-081xaEhysFzWkgE5Giluas3rg_Dp5-Fw5bh9r4-LSLhpkG14oOyEzrVVAOR4NPQXDA5JIAKdw1Xtan0t4znDHFGqQVix1O2lkm-Y2o1nlDxmM-_swpy5MAxb7yb_b2tA_b2ZMT_MoLndRqejWKdawyYST7h5bMr6ewZNg2ts52SqlXt4BveNWIWrq5mN-xO0D4_SyqC6DPun5N_4wZoyI0I7Zj5qE9qsosdLlqgBiPi_O18QoWqRWhfjJ2B6LoteSlSaF9QgRP409lFoKBDcs5eLguK1uPGPd4X-2AXixn217QIFztBBs-EQzqiJly5xXykGURHG_PUzSaCA2akgGKyD-5QDEIKA8VCniiFHwqoX8EQGdXCUeDjC5AkBk1rxhfeAM06bJ0H-Uz6KWvV5mFNhxwmUwArKSR-QBaN5soW7k63SvO8eF31GP_u2MC4QXjZnXD8YeHclcp3qt4nHGrM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HT=+cf40cdde-d9b9-4c8a-a402-a73a4ec99c66; ESTSSC=00; buid=AQABAAEAAABeAFzDwllzTYGDLh_qYbH84TKiKjYi6BuVyBpssR3qZD2fNIWjWH4IUGj1tgV1CjBekKsQGEtqYNmdMRIXd7N8BOo9vpLQC07NWlPoRa1jUH_-ayS6xTMT9xGQjDEZ1UggAA; fpc=Ah-RTB1jgiFCgCfEhHxEiA42YPZ6AgAAABNet9UOAAAAElWPKAEAAABFXrfVDgAAAA; stsservicecookie=ests; x-ms-gateway-slice=prod; clrc={%2218281%22%3a[%22MGmgPvDz%22%2c%22k+8Er6ui%22]}; brcap=1; esctx=AQABAAAAAABeAFzDwllzTYGDLh_qYbH8LpxpIlSUEu2HI0fzE_V_IRZe2RNJp-f2QqQ5Q3Ier3lWomWnATFbyAXP5tkq-U9ruARvMs7F-zosSlydkgEpjXJzyEyfRACjhZ_vKuEVUEqzKoCErpAbskdeRUTjqrMo70cB4tpzTB4GZFZonBLCTk0Ml3cUT-LLTZuhiu3Y_h4gAA
Host: login.microsoftonline.com
hpgact: 2101
canary: AQABAAAAAABeAFzDwllzTYGDLh_qYbH8a9SO3xGF3g6AWJIZDi54fWSNEiKErEt6YvrvJ3Fm-lIO4Y7kO9-ACPx-kAIHTbn_u5mhreKAsiP-Hn_b2PV7QPvjMYjHNFmOtYhXtFueCuvsxD-V2agrgXRBl82z91-Vv7ketwmG5XCIAJ4RBJBnEHiv2jAc671jIueFntKCDdwcbJ2t-karKLeSSx7VYafv5aDr8MhFDm-03Io8LpfLVSAA
hpgid: 1114
hpgrequestid: aa519c8c-30f9-46dd-95bb-ee6094414d00
client-request-id: 8fa2950c-7b79-400d-ac8c-630c65ec4c48
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Pragma: no-cache
Set-Cookie: fpc=Ah-RTB1jgiFCgCfEhHxEiA42YPZ6AgAAABNet9UOAAAAElWPKAEAAABFXrfVDgAAAA; expires=Wed, 19-Feb-2020 08:39:37 GMT; path=/; secure; HttpOnly
Set-Cookie: x-ms-gateway-slice=prod; path=/; secure; HttpOnly
Set-Cookie: stsservicecookie=ests; path=/; secure; HttpOnly; SameSite=None
Expires: -1
Cache-Control: no-cache, no-store
Date: Mon, 20 Jan 2020 08:39:36 GMT
Content-Length: 2356
X-Content-Type-Options: nosniff
P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"
x-ms-ests-server: 2.1.9898.20 - SIN1 ProdSlices
x-ms-request-id: 0c407fdc-ec18-4822-9d91-d3c662525100
Strict-Transport-Security: max-age=31536000; includeSubDomains
client-request-id: 8fa2950c-7b79-400d-ac8c-630c65ec4c48
Request Data
MIME Type: application/json
Encoding: UTF-8
Request Data:
Here is the content of the EndAuth:
Summary
URL: https://login.microsoftonline.com/common/SAS/EndAuth
Status: 200 OK
Source: Network
Address: *****
Initiator:
AjaxHandlerControl.js:110
Request
POST /common/SAS/EndAuth HTTP/1.1
Content-Type: application/json; charset=UTF-8
Accept: application/json
Accept-Language: vi-vn
Accept-Encoding: br, gzip, deflate
Origin: https://login.microsoftonline.com
User-Agent: Mozilla/5.0 (iPad; CPU OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1
Referer: https://login.microsoftonline.com/
Content-Length: 2249
Connection: keep-alive
Cookie: clrc={%2218281%22%3a[%22k+8Er6ui%22%2c%22MGmgPvDz%22%2c%22zHWAEBZj%22]}; fpc=AqGp0xmfg8lLgos3zMYZv1E2YPZ6AQAAAD9nt9UOAAAAElWPKAEAAABzZ7fVDgAAAA; stsservicecookie=ests; x-ms-gateway-slice=prod; ESTSAUTH=AQABAAQAAABeAFzDwllzTYGDLh_qYbH8PFcC4jCAPANOfMbq-YWj9-5u5ZM2Hz4lOtVb4th1FHqBtfAlPxYXbkTjGWbI0eqbYK3yBdWUzJaf_pjfuAqipUpJKfo388tRwdsTr9CtHJCsb2Bb-gj7weggZrS9qDlSiQ5yPiNdbpi1Q3eeed7T6rOIP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vRH3C3BdpJrafvkBKZaDOqdpoqgQWefiS4JAPtDRJlKCoraFryHLRKuKIwSwT_0-q0B2Wbz2eA0-uVeQoT9QRycHAIi4uWMbpSlQIoOh8uDQ4XWkKxC1qIPGH5ph6yZGr6DBs9zw8F52_ABHjQtjZeqLwOH_2tJwhHlhRjseQQ-sfPqs2unGfEqH_ea1HcT6ghJkMwKbyWw5FgO_HtElrYNn9BIQt04jPBBupWH57uw-GdKlnyk1_iUFhTIG8In4g6nfoyAAIABAAEABAAA; ch=2ZexXvpi5pBsPVR3WldndSN3Jss01W9lqt3Oo4atPto; ESTSAUTHLIGHT=+ccbda084-3cfd-4fba-a121-64822022264b; ESTSSC=00; buid=AQABAAEAAABeAFzDwllzTYGDLh_qYbH83h0-hsSMC7dM5dkdMfsldYZQhtZ_5IMn2ZWccmkXmkyQugUDrd1sqLyFIo52qI1ICYVz0_3ozkcTDV1vemApeSunFPxJEyWbLhKWIIMiRSwgAA; brcap=1; esctx=AQABAAAAAABeAFzDwllzTYGDLh_qYbH8C_SETJvY2bJWBn6b4YBwYZ7oWTYtAHOB03Kf6w7z6vx4agejzLR-KrengZwkpZuVxa46rpVJHyjKDFiK21Ze093B5qYDaOrkz3uZPgiJdYqVbjuCum0RxKS6CmtEx7u5UHUmbF28DhO-fw7SE8GiQOgk-WMKtZ5l15V323DZ2yAgAA
Host: login.microsoftonline.com
hpgact: 2101
canary: AQABAAAAAABeAFzDwllzTYGDLh_qYbH8B01oIe03wUWEzPISTHAYY9DIzppZsJdHlAJVTT_qDkwW63QTbVzZyGyuWTH8DI13YW7IQFYQyNSmc82iyDqXYnIYXKzNwTXHaKFvgefiHsMs4s_H-iKu7nbw5riTkXpshEv8RqrNzUCQ5RzPkN_DmRrl6pxzpx5PE9xy_lbhsMNJhlRHR9ydR32alGrgIUMk5jeiWnXwyn-Iv0ZeaTm_liAA
hpgid: 1114
hpgrequestid: 6046baec-30dd-4d4d-b4c0-c2a9bdd65000
client-request-id: 907865da-9681-4d95-a65a-dd40a3661f79
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Pragma: no-cache
Set-Cookie: fpc=AqGp0xmfg8lLgos3zMYZv1E2YPZ6AQAAAD9nt9UOAAAAElWPKAEAAABzZ7fVDgAAAA; expires=Wed, 19-Feb-2020 09:19:24 GMT; path=/; secure; HttpOnly
Set-Cookie: x-ms-gateway-slice=prod; path=/; secure; HttpOnly
Set-Cookie: stsservicecookie=ests; path=/; secure; HttpOnly; SameSite=None
Expires: -1
Cache-Control: no-cache, no-store
Date: Mon, 20 Jan 2020 09:19:23 GMT
Content-Length: 2356
X-Content-Type-Options: nosniff
P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"
x-ms-ests-server: 2.1.9898.20 - SIN1 ProdSlices
x-ms-request-id: be26f84b-5386-4b04-a31f-64f06db04e00
Strict-Transport-Security: max-age=31536000; includeSubDomains
client-request-id: 907865da-9681-4d95-a65a-dd40a3661f79
Request Data
MIME Type: application/json
Encoding: UTF-8
Request Data:
Here is the content of the failed signin-oidc content:
Summary
URL: https://*****/signin-oidc
Status: 500 Internal Server Error
Source: Network
Address: *****
Request
POST /signin-oidc HTTP/1.1
Cookie: ARRAffinity=b67cf4989142f516cf1224c1da63f82fb954c6d5a9d7f17d287740c0647a1f76
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Content-Type: application/x-www-form-urlencoded
Origin: https://login.microsoftonline.com
Content-Length: 1886
Accept-Language: vi-vn
Host: *******
User-Agent: Mozilla/5.0 (iPad; CPU OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1
Referer: https://login.microsoftonline.com/kmsi
Accept-Encoding: br, gzip, deflate
Connection: keep-alive
Response
HTTP/1.1 500 Internal Server Error
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Expires: -1
Date: Mon, 20 Jan 2020 08:23:38 GMT
Transfer-Encoding: Identity
Cache-Control: no-cache
Access-Control-Allow-Origin: *
X-Powered-By: ASP.NET
Strict-Transport-Security: max-age=2592000
Server: Kestrel
Request Data
MIME Type: application/x-www-form-urlencoded
id_token: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6InBpVmxsb1FEU01LeGgxbTJ5Z3FHU1ZkZ0ZwQSJ9.eyJhdWQiOiJjNjA4ZjhhYi1lZjA4LTRjYjEtYjAzMy1hNzQyMjg0ODA3NmEiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vMWZkMWRmYzQtZTVlMy00ZDM3LWFkZGItM2VjYTQxMWVjYWVjL3YyLjAiLCJpYXQiOjE1Nzk1MDgyOTMsIm5iZiI6MTU3OTUwODI5MywiZXhwIjoxNTc5NTEyMTkzLCJhaW8iOiJBV1FBbS84T0FBQUFSUWhkYzc3SWNXN2dMb0RHcUVkN2pnV3hoRDdtK29Kb0NPS3A0SkRnS3VlL3JCdno2V2NYNysvOUlYYXREWURKeUp6Y0I5MWs5SjJIbVJSZ2tUVEsyNGdWM0dLS3hteXVBTnJGUk4waDJIdS9jYVN6K1FzNUc3R21kYXJSVG5jSCIsIm5hbWUiOiJOZ29jLCBMdXUgVGhpIFBodW9uZyAoU0FMRSkiLCJub25jZSI6IjYzNzE1MTA1MzMyNTE2MTI4OC5OVGRsTkdFMU1ESXRNRGRpWWkwME1tRTVMV0ppWTJZdE1URXlaak15WW1FNU5UYzVObU16WkdJM01tSXRObU5tT1MwME5qVmlMVGd4TVRndFpqY3dOMlUxT0dJNU9EVTUiLCJvaWQiOiJkZWJlNTRlNy0wOWE0LTQ2MDItYmFlZC1jNWRjN2VkM2NiMjMiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJuZ29jLmx1dXRoaXBodW9uZ0Bub3ZhbGFuZC5jb20udm4iLCJzdWIiOiJEV1E1Y0pEbVA3WHI2Szloakx1enNiS2RmUUs3cERWNzBYbmpYTkVmbzRjIiwidGlkIjoiMWZkMWRmYzQtZTVlMy00ZDM3LWFkZGItM2VjYTQxMWVjYWVjIiwidXRpIjoiMHdQNEIyUWhpa081WEJHYkxoRkxBQSIsInZlciI6IjIuMCJ9.MO2h7kO8I9ANFI9TgJZCVGpl0J7oxmeMQPMKM1Vt8AzXqLxN46CS1q4QlAR8x8Ca_D8IPpB277HpumUVc4vseffBJ9i_M_6I4Qqt2bzmHCcIRqTGluc8C-UlEBFvIBshOILCjVpS6feESboRTbWkIgVPfArlb03FtvS1HDinaWpAWRMPSNr40sYvF_3I7VT4wk52Ne1ZZRIhB71wAbeYzlcBlXQJA8yZhg2oGuoBy3B0V45v8f9Kskd7wIgvq0rI-kxSTKIo7pxHclNnvjDJm4J4DeAdA5dzKdmaCTzN4EMDsOZY0y1vM3UdJnM1BQkHip3FyRQ1Hj6eolbPwafdaQ
state: CfDJ8H2WPQdBhutNkjRYYA9J-dr_EWgqMxJ32ez0tMZ1rrPWWnow1tT8M7sqGJspDcOU08NK2Hhg12jGCXAuI8biXhycBguS-EZgJnh2pYPq7SE8Fin-XaF17rJDxNXCEp-B1Rw8sTVbNLo-cdaTf0tqKE01Ey2srTrQA3-5Y5EgsQnZ-PuhzykvglYxeBbV09e2wZ7Cw0AngaZBwTYrs-3ETv8sakZwXTX2gFjUy5q61MCxpdhHepRvd2lT7ZEAWNXGrzBBVoM-VM0C-Lztf65ZqNhP_0U8vgwHsxvzA47KWEGbdMLC80xoGNLO1p8zU3n9Yzkdp0fsc5z7ExBTVAexe6WBoALObVNPSWBOhR0BEdRFgkyPfWJBYBbQTqwv-C6CwBojTOI4e4GPGZfmJXvlKQg
session_state: 7f9db494-e7d2-4803-b8ec-979d0dad856f
Return this page and can't go anything page on my website

Related

How to send post request to REST API CakePHP 3.6

Backend CakePHP 3.6 REST , frontend React
Request
Request URL: http://localhost/restcake/v1/posts.json
Request Method: POST
Status Code: 400 Bad Request
Remote Address: [::1]:80
Referrer Policy: no-referrer-when-downgrade
Reponse
code: 400
file: “PATHTO\vendor\cakephp\cakephp\src\Controller\Component\SecurityComponent.php”
line: 351
message: “’_Token’ was not found in request data.”
url: “/v1/translations.json”
Request header
Accept: application/json
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,mn-MN;q=0.8,mn;q=0.7
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 68
Content-Type: application/json
Cookie: csrfToken=1ca4d0479b6721049b17fa879e269816515cdd216e2f0a85a828dad33fa2bacf3a341f74b7d08b75ffa3b9fbebd0219914d50d30e6abeec45129c2fe39e1f7fa; CAKEPHP=pv2nkumt1a32urftf2jvq5nrrm; remember_me=Q2FrZQ%3D%3D.ZGYyNDNiMjdkOTRlNDMyZGVjYzhkMWUwZTE4MTJhOWJjZjBkZjEzODA5MWE2ZjJkOWRhN2RkNTg0ZjEwZDM4ML2ESQrHcOqYaNiMcRSYoK4WcuCAPx%2Fz7UgmA6cBU6pZXYnQX29kT2zUhGDCVlU%2F0ZPjlHtX7qiyIsuEwiCrmBonaNBD6G8QL4WMgap2QOieQ6KV%2BnQjRKz%2FYvzyuxwcia7ChJNdcvy1%2B9UzCSSLWX%2BDBR%2F1Qivlvc0Dl1HL6tX%2BaWWc6IfoT82wS331XCMUzcIo0yQzyVp595PkT%2F8NjXtyK3M%2BeB5bKy%2FMYCAIrXLJWVCse9NYACix35fST0unQ69FBxihlu0Wli%2BAT3NGQWo%3D
Host: localhost
Origin: http://localhost:4000
Pragma: no-cache
Referer: http://localhost:4000/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36
I temporary disabled CORS in middleware.

Yeoman,Grunt, AngularJS 404 cannot Post /

I have this little angular app on the frontend which is a food list. So write a food and click submit and it will show the list.
When I add a food I query my backend wich is a sails app at localhost:1337 and it gets updated. The problem is I get redirected to
localhost:9000/#/food and get 404.
This is the faulty request
POST / HTTP/1.1
Host: localhost:9000
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image /webp,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
Content-Type: application/x-www-form-urlencoded
Cookie:sails.sid=s%3A8gIjNxaZVE9dMr7nonXJzEaQ9hUcvcHm.Sp0K6ezep%2F7Y%2BV6TivtdRxqiBV 2S1LdH2IDNPWS9Ikk
Origin: http://localhost:9000
Referer: http://localhost:9000/
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36
X-DevTools-Emulate-Network-Conditions-Client-Id: 137B2031-138E-4B6B-A3AE- FB8EE96E9015
HTTP/1.1 404 Not Found
Connection: keep-alive
content-length: 14
Content-Type: text/html; charset=utf-8
Date: Mon, 23 Feb 2015 12:21:51 GMT
X-Content-Type-Options: nosniff
The other request that gets code 200 and update the server model looks like this:
OPTIONS /food HTTP/1.1
Host: localhost:1337
Accept: */*
Accept-Encoding: gzip, deflate, sdch
Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
Access-Control-Request-Headers: accept, content-type
Access-Control-Request-Method: POST
Origin: http://localhost:9000
Referer: http://localhost:9000/
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36
X-DevTools-Emulate-Network-Conditions-Client-Id: 137B2031-138E-4B6B-A3AE- FB8EE96E9015
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: content-type, access-control-allow-origin, authorization,X-Requested-With
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
Access-Control-Allow-Origin: http://localhost:9000
Allow: GET,POST,PUT,HEAD,DELETE,TRACE,COPY,LOCK,MKCOL,MOVE,PURGE,PROPFIND,PROPPATCH, UNLOCK,REPORT,MKACTIVITY,CHECKOUT,MERGE,M- SEARCH,NOTIFY,SUBSCRIBE,UNSUBSCRIBE,PATCH,SEARCH,CONNECT
Connection: keep-alive
Content-Length: 175
Content-Type: text/html; charset=utf-8
Date: Mon, 23 Feb 2015 12:21:51 GMT
set-cookie: sails.sid=s%3A_kBdyRZgZ23Gh9YLkZfWBgnMody- jq-S.IY71%2BhJiBxTd19YIG2tgS2EOn1LPT%2BD9QAEQWtVB%2FbE; Path=/; HttpOnly
X-Powered-By: Sails <sailsjs.org>
At first I was looking at sails but I have CORS enabled and everything just like this:
https://github.com/tarlepp/angular-sailsjs-boilerplate/blob/master/backend/config/cors.js
So maybe it's more an angular issue. The request that fails is from the frontend to itself so just a redirect on itself when it has been updated on the server. I don't get why the request is denied...
If you want to take a look at the code:
http://okamuuu.hatenablog.com/entry/2014/04/10/135240
Issues seem the same as this Yeoman, Grunt, AngularJS and error 404 on POST form but that doesn't help me
Well, apparently your request is going to the port 9000:
Host: localhost:9000
Yet you said your app is running at port 1337.
So, in your $http requests, you need to specify the port. Otherwise, it will use the port your browser is currently connected to (9000) and there's no app there!
So, instead of
$http.get('/someUrl')
Try
$http.get('http://localhost:1337/someUrl')

How to enable Angular $http redirect on CORS

I have a node/express aplication with CORS enabled
When I do POST /login to my app does a redirect to /failure or /success
but always a i get a
XMLHttpRequest cannot load http://exampledomain.com/login. The request was redirected to 'http://exampledomain.com/success', which is disallowed for cross-origin requests that require preflight.
the $http do two requests to the server
OPTIONS request
HTTP/1.1 204 No Content
Access-Control-Allow-Origin: http://otherdomain.com
Vary: Origin
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET,PUT,POST,PATCH,DELETE
Access-Control-Allow-Headers: accept, content-type
Connection: keep-alive
Options response
HTTP/1.1 204 No Content
Access-Control-Allow-Origin: http://otherdomain.com
Vary: Origin
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET,PUT,POST,PATCH,DELETE
Access-Control-Allow-Headers: accept, content-type
Connection: keep-alive
POST request
POST /admin/login HTTP/1.1
Host: exampledomain.com
Connection: keep-alive
Content-Length: 43
Accept: application/json, text/plain, */*
Origin: http://otherdomain.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2267.0 Safari/537.36
Content-Type: application/json;charset=UTF-8
Referer: http://otherdomain.com
Accept-Encoding: gzip, deflate
Accept-Language: es-419,es;q=0.8
POST response
HTTP/1.1 302 Moved Temporarily
Vary: X-HTTP-Method-Override, Origin, Accept
Access-Control-Allow-Origin: http://otherdomain.com
Access-Control-Allow-Credentials: true
Location: /success
Content-Type: text/plain; charset=utf-8
Content-Length: 45
set-cookie: cookie-data; Path=/; HttpOnly
Connection: keep-alive
I think the headers are correct but something is missing about the Location header. Can help me with this
I'm doing the request with $http like follows
$http.defaults.useXDomain = true;
$http.post('http://exampledomain/login', {
username: 'user',
password: 'pass'
}).success(...).error(...)
but the success is never called
CORS is not enabled for http://exampledomain.com, thus no requests can be made to it. In fact the browser does a preflight check and since it fails the requests are not actually sent to the server at all.
The only way to change this is to enable CORS on the server for your domain.

Why doesn't chrome cache google app engine blobstore

I'm using blobstore to serve audio files embedded in HTML5 audio element. Because I have a blobkey as a part of url I can assume that for any given url its content will never change. That looks like a perfect setup for caching.
Yesterday I implemented a solution which seemed to work. At least I remember that it worked ;). Unfortunately today I discovered, that it doesn't work with Chrome and production server. It works perfectly with Internet Explorer and Firefox. It even works with Chrome and development server - I use version 1.7.6. My solution uses Cache-Control headers, but it seems that only Firefox makes any use of it. Additionally I added an ETag header. When I discover If-None-Match request header with the same value I return 304 code. That seems to work with Internet Explorer. It also works with Chrome and development server. I remember that it had worked yesterday with Chrome and production, but I'm not completely sure. Anyway the problem I have is why both caching mechanisms are ignored by Chrome. I suspect that it may have something to do with chunked encoding which is generated only for chrome, but I don't understand why caching is disabled in that case
And now a lot of details.
Firefox
Initial request headers:
Host: eduzabawy.appspot.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5
Accept-Language: pl,en-us;q=0.7,en;q=0.3
Range: bytes=0-
Referer: http://eduzabawy.appspot.com/dziecko/
Cookie: children="jEDor1B8VRDRJreWmUVlUQ\075\075"; session=eyJfc2lkIjoiWk91QmlsOEJlTEd4QVFuYVFiYkpsTyJ9|1365190508|81d81772f6f409dd57ad43a9f447f92d1b56d29e
Connection: keep-alive
Initial response headers:
HTTP/1.1 206 Partial Content
Cache-Control: public max-age=100000000
Content-Range: bytes 0-37249/37250
Content-Type: audio/ogg
Date: Fri, 05 Apr 2013 19:45:47 GMT
Etag: blobstore
Server: Google Frontend
X-Firefox-Spdy: 3
On subsequent loads it seems that Firefox doesn't even try to fetch the files. This is how I thought it should work.
Internet Explorer
Initial request headers:
Accept: */*
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Referer: http://eduzabawy.appspot.com/dziecko/
Accept-Language: pl-PL
Accept-Encoding: gzip, deflate
Host: eduzabawy.appspot.com
Connection: Keep-Alive
Cookie: children="WyzUQwHEzwX6qnjfn21KEw\075\075"; session=eyJfc2lkIjoia2VOd0llR0hvRHU1cUN0cE1QSWRpWCJ9|1365192921|f2279f82b21947c4d064dbf44a5ce9e1bd95cc0d
Initial response headers:
HTTP/1.1 200 OK
Cache-Control: public max-age=100000000
ETag: blobstore
Content-Type: audio/mpeg
Date: Fri, 05 Apr 2013 20:15:23 GMT
Server: Google Frontend
Content-Length: 4637
Subsequent request headers:
Accept: */*
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Referer: http://eduzabawy.appspot.com/dziecko/
Accept-Language: pl-PL
Accept-Encoding: gzip, deflate
Host: eduzabawy.appspot.com
If-None-Match: blobstore
Connection: Keep-Alive
Cookie: children="WyzUQwHEzwX6qnjfn21KEw\075\075"; session=eyJfc2lkIjoia2VOd0llR0hvRHU1cUN0cE1QSWRpWCJ9|1365192921|f2279f82b21947c4d064dbf44a5ce9e1bd95cc0d
Subsequent response headers:
HTTP/1.1 304 Not Modified
ETag: blobstore
Content-Type: audio/mpeg
Content-Length: 4637
Chrome + development server
Initial request headers:
Host: localhost:8080
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31
Accept: */*
Referer: http://localhost:8080/dziecko/
Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.3
Cookie: children="xYNsqzfdtZ-2Z764lFSzk1Ed8-g1QoNlcaexsD79gSY\075"; session=eyJfc2lkIjoiTE9CZDc0SHJENHF4OWJua1J4S3dTQSJ9|1365192253|37815772acab0bf44a0c501ea0fd0dc7c617dd09
Range: bytes=0-
Initial response headers:
HTTP/1.1 206 Partial Content
etag: blobstore
cache-control: public max-age=100000000
content-type: audio/mpeg
Content-Range: bytes 0-4636/4637
Content-Length: 4637
Server: Development/2.0
Date: Fri, 05 Apr 2013 20:32:19 GMT
Subsequent request headers:
Host: localhost:8080
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31
Accept: */*
Referer: http://localhost:8080/dziecko/
Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.3
Cookie: children="xYNsqzfdtZ-2Z764lFSzk1Ed8-g1QoNlcaexsD79gSY\075"; session=eyJfc2lkIjoiTE9CZDc0SHJENHF4OWJua1J4S3dTQSJ9|1365192253|37815772acab0bf44a0c501ea0fd0dc7c617dd09
Range: bytes=0-4636
If-None-Match: blobstore
Subsequent response headers:
HTTP/1.1 304 Not Modified
Content-Type: text/html
Server: Development/2.0
Date: Fri, 05 Apr 2013 20:33:08 GMT
Chrome + production server
Initial request headers:
Host: eduzabawy.appspot.com
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31
Accept: */*
Referer: http://eduzabawy.appspot.com/dziecko/
Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.3
Cookie: children="sU9aqnqEf67eZFpS7BKSMw\075\075"; session=eyJfc2lkIjoieFlGWlJLMnRwSHJuOVFCb1haTnJLUCJ9|1365194193|2a13cd9eb7aceeb40c43bd82a763d893436d9f1f
Range: bytes=0-
Initial response headers:
HTTP/1.1 206 Partial Content
Cache-Control: public max-age=100000000
ETag: blobstore
Content-Type: audio/mpeg
Content-Range: bytes 0-4636/4637
Date: Fri, 05 Apr 2013 20:36:35 GMT
Server: Google Frontend
Transfer-Encoding: chunked
Subsequent requests and responses are the same as initial.
Your max-age seems too long and going over 3 years... I read from somewhere the maximum you should set in GAE is no more than 1 year.
Anyway, there's one more header you should try to set (Pragma: Public), which worked for me (I'm caching image from blobstore though, here's a few lines from my source code):
httpResponse.Header().Set("Cache-Control", "public, max-age=600")
httpResponse.Header().Set("Pragma", "Public")
blobstore.Send(httpResponse, project.ImageBlobKey)
By the way the above also cause Google to delivery your file from the edge cache, which really speed static resources up a lot!

Firefox 3.6.13 configuration for spnego authentification

I'd like to access to a web application which requires spnego authentification.
This application is running on a network on which i'm connected by VPN connection. Proxy not used.
It works fine under IE6/7/8, Chrome but not firefox 3.6.13
The matter on firefox is: I don't have the prompt message box to enter username and password
To configure my FF, i applied the following instructions, adding the domain name to the trusted and delegation uris fields.
Trying to access to the application, i get the following error message:
A browser did not respond to authentication challenge sent by a server.
Most probably your browser is not configured properly to handle SPNEGO authentication challenge or does not support SPNEGO.
Please, contact your System Administrator to deal with the problem.
Using TCPMon to get an overview of the informations received:
GET /AppName HTTP/1.1
Host: app.domain:8182
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0E)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: JSESSIONID=6E058E24D9E1873C80B14C56EC59B1E4
GET /AppName/ HTTP/1.1
Host: app.domain:8182
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0E)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: JSESSIONID=6E058E24D9E1873C80B14C56EC59B1E4
GET /AppName/logon HTTP/1.1
Host: app.domain:8182
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0E)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: JSESSIONID=6E058E24D9E1873C80B14C56EC59B1E4
HTTP/1.1 302 Déplacé Temporairement
Server: Apache-Coyote/1.1
Location: http://app.domain:8182/AppName/
Transfer-Encoding: chunked
Date: Tue, 14 Dec 2010 16:16:28 GMT
0
HTTP/1.1 302 Déplacé Temporairement
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
Location: http://app.domain:8182/AppName/logon
Content-Type: text/html
Content-Length: 0
Date: Tue, 14 Dec 2010 16:16:28 GMT
HTTP/1.1 401 Non-Autorisé
Server: Apache-Coyote/1.1
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 01:00:00 CET
WWW-Authenticate: Negotiate
Connection: close
Content-Type: text/html
Transfer-Encoding: chunked
Date: Tue, 14 Dec 2010 16:16:28 GMT
4b9
I've checked for the other browsers and i got the same informations.
Do someone have an idea why FF can't interprete it, prompt a dialog box or enter the application ?
Thanks in advance for any help.
Best regards.

Resources