skoba / docker-ethercis

Docker environment for EtherCIS, an open source platform compatible with the OpenEHR standard
MIT License
0 stars 1 forks source link

Error 403 #1.0.0 Your secretSessionId is invalid, no access to ehrserver. #2

Open daniloblb opened 6 years ago

daniloblb commented 6 years ago

Hello, I got the service working, now I'm trying to consume, but I'm having trouble creating a valid session, can you help me?

Error 403 #1.0.0 Your secretSessionId is invalid, no access to ehrserver.

HTTP ERROR 403

Problem accessing /rest/v1/ehr. Reason:

    #1.0.0 Your secretSessionId is invalid, no access to ehrserver.


Powered by Jetty:// 9.4.z-SNAPSHOT
"
daniloblb commented 6 years ago

I have a postman project that I use to do the tests.

skoba commented 6 years ago

This is rather easy.

  1. To get session_id, I use the credential, ID: root, Password: secret. The information about authentication is here. https://github.com/skoba/docker-ethercis/blob/master/application/ethercis-1.2.0/conf/security/authenticate.ini

  2. POST id and password. curl -X POST -i 'http://localhost:8888/rest/v1/session/?username=root&password=secret'

you will get the followings. You should use http header paramater key: Ehr-Session, and value: sessionId:172.18.0.3-root-1535555490835--46776562-9 to the next query.


HTTP/1.1 200 OK
Date: Wed, 29 Aug 2018 15:11:30 GMT
Content-Type: application/json;charset=UTF-8
x-reconnect: false
x-session-name: /node/ehrserver/client/root/-1
x-sessions-in-use: 1
Ehr-Session: sessionId:172.18.0.3-root-1535555490835--46776562-9
__rcvTimestampStr: 2018-08-29 15:11:30.859Z
x-session-timeout: 1800000
x-max-session: 20
Content-Language: en-US
Content-Length: 207
Server: Jetty(9.2.z-SNAPSHOT)

{
  "meta" : {
    "href" : "rest/v1/session?sessionId=sessionId:172.18.0.3-root-1535555490835--46776562-9"
  },
  "action" : "CREATE",
  "sessionId" : "sessionId:172.18.0.3-root-1535555490835--46776562-9"
}
  1. Use sessionID as query parameter

curl -X POST -H 'Ehr-Session:sessionId:172.18.0.3-root-1535570266743--2067865307-17' -i http://localhost:8888/rest/v1/ehr

daniloblb commented 6 years ago

It worked! Now when trying to include a template I get the following error:

Error 500 #1.0.0 Invocation exception to method:create:java.lang.NoClassDefFoundError: org/openehr/schemas/v1/TemplateDocument$Factory

HTTP ERROR 500

Problem accessing /rest/v1/template/. Reason:

    #1.0.0 Invocation exception to method:create:java.lang.NoClassDefFoundError: org/openehr/schemas/v1/TemplateDocument$Factory


Powered by Jetty:// 9.4.z-SNAPSHOT
skoba commented 6 years ago

I cannot see what you did to access template.

daniloblb commented 6 years ago

IT'S VERY BIG I CAN NOT ATTACH, CAN I SEND YOU AN EMAIL? Which email?

daniloblb commented 6 years ago

I'm using a postman project, with all REST requests set up. Attached also, I thank you immensely.

Em ter, 20 de nov de 2018 às 14:56, Shinji KOBAYASHI < notifications@github.com> escreveu:

I cannot see what you did to access template.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skoba/docker-ethercis/issues/2#issuecomment-440347063, or mute the thread https://github.com/notifications/unsubscribe-auth/Apjms7yoNC2aaBt4oJ5Ro3KxFG64BSNeks5uxDRDgaJpZM4YpuIA .

-- att,

Danilo Burgos Lobão Barroso

skoba commented 6 years ago

What did you done? GET? POST? Parameters?

daniloblb commented 6 years ago

POST

Enviado do Email para Windows 10

De: Shinji KOBAYASHI Enviado:terça-feira, 20 de novembro de 2018 16:11 Para: skoba/docker-ethercis Cc:daniloblb; Author Assunto: Re: [skoba/docker-ethercis] Error 403 #1.0.0 Your secretSessionId isinvalid, no access to ehrserver. (#2)

What did you done? GET? POST? Parameters? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

skoba commented 6 years ago

No podemos enviar "file" para email, si podemos anotarlo a la esta "issue" page con markdown y adjuntando el archivo.

skoba commented 6 years ago

Could you tell me what you would like to do by template? Then, I can show you the way.

daniloblb commented 6 years ago

I want to insert a template and then insert a document for a patient. Generally I want to have all REST commands to use the Ethercis service.

I'm working in a development environment where I've already put the environment up and running as well as you can track.

I have already been able to create a session and list the templates.

Em qua, 21 de nov de 2018 às 01:46, Shinji KOBAYASHI < notifications@github.com> escreveu:

Could you tell me what you would like to do by template? Then, I can show you the way.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skoba/docker-ethercis/issues/2#issuecomment-440519878, or mute the thread https://github.com/notifications/unsubscribe-auth/Apjms9OVQSDnqeEMP5unpWXW3t7kUlBpks5uxMyfgaJpZM4YpuIA .

-- att,

Danilo Burgos Lobão Barroso

skoba commented 6 years ago

Please refer to EtherCIS API Docuemnt http://docs.ethercis.org/APIs.html

EtherCIS is compatible with EhtScape API, but not all are implemented. https://www.ehrscape.com/api-explorer.html

You should POST with session id in headers, and raw opt file(XML) in body. to localhost:8888/rest/v1/template

skoba commented 6 years ago

Mail attachments do not forward to either me or this issue. You can attach file via this issue page on GitHub Web, not via email.