Giter Club home page Giter Club logo

Comments (4)

dickhardt avatar dickhardt commented on August 29, 2024

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.c7bsS5LCqDydkISNsF17rp9VHhQ1a4zcv9Fq7Y3Z5Pc

authorizations=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.

GregTurner avatar GregTurner commented on August 29, 2024

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.

dickhardt avatar dickhardt commented on August 29, 2024

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.

GregTurner avatar GregTurner commented on August 29, 2024

Doh, now its my bad.

from a2p3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.