Comments (4)
My bad, I changed the signature profile, updated docs I have on my machine, but did not share.
Since it is a JSON document being POSTed, it is an array, not a comma separated list for the resources
{ token: token
, authorizations: [ resource1, resource2]
}
On Jan 18, 2013, at 9:31 PM, GregTurner [email protected] wrote:
Request from Agent:
POST http://registrar.local.a2p3.net:8080/authorizations/requests HTTP/1.1
Host: registrar.local.a2p3.net:8080
Connection: keep-alive
Content-Length: 91
Cache-Control: max-age=0
Accept: /
Origin: http://localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost/a2p3_agent/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: connect.sess=s%3Aj%3A%7B%7D.c7bsS5LCqDydkISNsF17rp9VHhQ1a4zcv9Fq7Y3Z5Pcauthorizations=email.local.a2p3.net%2Cregistrar.local.a2p3.net&token=nf1-Fv771smnEPSWlmVMiQ
Response from registrar:
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 850
Date: Sat, 19 Jan 2013 05:26:13 GMT
Connection: keep-alive{
"error": {
"code": "UNKNOWN",
"message": "Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'",
"stack": "TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'\n at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)\n at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)\n at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)\n at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9\n at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)\n at process.startup.processNextTick.process._tickCallback (node.js:244:9)"
}
}ServerConsole:
TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 6 ms - -
Error: No 'token' parameter in POST
at checkValidAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:21:13)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at param (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:135:11)
at pass (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:142:5)
at Router._dispatch (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:170:5)
at Object.router (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:33:10)
at next (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\node_modules\connect\lib\proto.js:199:15)
at Object.cookieSession as handle
at next (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\node_modules\connect\lib\proto.js:199:15)
at Object.cookieParser as handle
registrar.local.a2p3.net POST /authorizations/requests 200 5 ms INVALID_API_CALL
No 'token' parameter in POST
TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 5 ms - -
TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 4 ms - -
TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 10 ms - -—
Reply to this email directly or view it on GitHub.
from a2p3.
Makes it consistent, thank-you. After switching to JSON, critical error:
Request:
POST http://registrar.local.a2p3.net:8080/authorizations/requests HTTP/1.1
Host: registrar.local.a2p3.net:8080
Connection: keep-alive
Content-Length: 103
Cache-Control: max-age=0
Accept: /
Origin: http://localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost/a2p3_agent/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: connect.sess=s%3Aj%3A%7B%7D.c7bsS5LCqDydkISNsF17rp9VHhQ1a4zcv9Fq7Y3Z5Pc
{"token":"nf1-Fv771smnEPSWlmVMiQ","authorizations":["email.local.a2p3.net","registrar.local.a2p3.net"]}
Response:
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 98
Date: Sat, 19 Jan 2013 05:53:52 GMT
Connection: keep-alive
{
"error": {
"code": "INVALID_API_CALL",
"message": "No 'token' parameter in POST"
}
}
from a2p3.
You have the wrong content type
application/x-www-form-urlencoded
must be
application/json
On Jan 18, 2013, at 9:58 PM, GregTurner [email protected] wrote:
Makes it consistent, thank-you. After switching to JSON, critical error:
Request:
POST http://registrar.local.a2p3.net:8080/authorizations/requests HTTP/1.1
Host: registrar.local.a2p3.net:8080
Connection: keep-alive
Content-Length: 103
Cache-Control: max-age=0
Accept: /
Origin: http://localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost/a2p3_agent/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: connect.sess=s%3Aj%3A%7B%7D.c7bsS5LCqDydkISNsF17rp9VHhQ1a4zcv9Fq7Y3Z5Pc{"token":"nf1-Fv771smnEPSWlmVMiQ","authorizations":["email.local.a2p3.net","registrar.local.a2p3.net"]}
Response:
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 98
Date: Sat, 19 Jan 2013 05:53:52 GMT
Connection: keep-alive{
"error": {
"code": "INVALID_API_CALL",
"message": "No 'token' parameter in POST"
}
}—
Reply to this email directly or view it on GitHub.
from a2p3.
Doh, now its my bad.
from a2p3.
Related Issues (20)
- concurrent sample-app register caused errors HOT 1
- registrar server dies if user cancels logon
- Bank: IE returns to login page after accepting terms of service HOT 1
- Setup: Cancel button doesn't cancel - user is enrolled HOT 1
- Adding agent using QR code - mouse pointer location HOT 1
- Bank :: close API for Bank Mobile App
- Bank: Login button results in page without logout HOT 1
- Resource server login not working on IE HOT 1
- add ix property to Agent Request
- registrar /report returns invalid request to agent
- bank app fails on open account and login if you remove the authorizations
- on setup, stop the facebook auto logon.
- last access missing in responses to /authorizations/list
- Mobile Safari: Login with Facebook button opens new tab HOT 2
- invalid request from App -> Agent -> Registrar causes registrar to halt HOT 1
- agent gets 'MISSING_TOKEN' when user denies/cancels the logon on the agent HOT 3
- deleting an app may not clean up all of DB
- registries not showing application name
- Verify that cancel QR works HOT 2
- IIW feedback
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from a2p3.