ufal / clarin-dspace

clarin-dspace digital repository based on DSpace and LINDAT/CLARIN DSpace
http://lindat.cz
BSD 3-Clause "New" or "Revised" License
27 stars 18 forks source link

Shibboleth - 1.3.2.6. No mail header #1081

Open kosarko opened 1 year ago

kosarko commented 1 year ago

Expectation

Actual behavior

no email accepted:

The FE shows some basic "can't send email" error; underneath it gets a 400 bad request from /api/autoregistration

the tomcat logs (cf. #1033 ) contain:

Oct 04 16:27:40 dspace-dev tomcat9[3422607]: Error parsing HTTP request header
Oct 04 16:27:40 dspace-dev tomcat9[3422607]:  Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
Oct 04 16:27:40 dspace-dev tomcat9[3422607]: java.lang.IllegalArgumentException: Invalid character found in the request target [/server/api/autoregistration?netid=no_email@ufal.hide.ms.mff.cuni.cz[https://ufal-point-dev.ufal.hide.ms.mff.cuni.cz/idp/shibboleth]&email=my_email@mff.cuni.cz ]. The valid characters are defined in RFC 723>Oct 04 16:27:40 dspace-dev tomcat9[3422607]:     at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:494)
Oct 04 16:27:40 dspace-dev tomcat9[3422607]:     at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:271)
Oct 04 16:27:40 dspace-dev tomcat9[3422607]:     at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
Oct 04 16:27:40 dspace-dev tomcat9[3422607]:     at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
Oct 04 16:27:40 dspace-dev tomcat9[3422607]:     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1735)
Oct 04 16:27:40 dspace-dev tomcat9[3422607]:     at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
Oct 04 16:27:40 dspace-dev tomcat9[3422607]:     at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
Oct 04 16:27:40 dspace-dev tomcat9[3422607]:     at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
Oct 04 16:27:40 dspace-dev tomcat9[3422607]:     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
Oct 04 16:27:40 dspace-dev tomcat9[3422607]:     at java.base/java.lang.Thread.run(Thread.java:833)

Is percent encoding (or base64?) of the params a solution?

Originally posted by @kosarko in https://github.com/ufal/clarin-dspace/issues/1066#issuecomment-1747137898

The rest of the use case remains untested:

kosarko commented 11 months ago
kosarko commented 9 months ago

Tested yesterday; but no email received. There's no trace of an email being sent in dspace logs...

(Note: from the mail server logs it seems that email was actually sent, but bounced. I'd rather not dig through mail server logs to know if dspace actually tried to send and email)

milanmajchrak commented 3 weeks ago

Should be done here: https://github.com/dataquest-dev/DSpace/pull/644 https://github.com/dataquest-dev/DSpace/pull/772

Tracked conversation: https://github.com/dataquest-dev/dspace-angular/issues/591

kosarko commented 3 weeks ago

@milanmajchrak I'm having an issues with this, I'm stuck at a white page with running dots... See the attached video

https://github.com/user-attachments/assets/97702643-1a59-400d-a3bf-9d7dbb48ffe4

(I'm getting the verification token from dspace logs as the system is currently set not to send emails)

Edit The version: BE: Git hash: 68fb2030c514d92930980064d1f3cb0373c48de4 Date of commit: 2024-11-04 12:43:04 +0100This info was generated on: 2024-11-04 12:48:38 CET+0100 Build run: https://github.com/dataquest-dev/DSpace/actions/runs/11663529816

FE:

Git hash:
bd553228ea91c88ca0e2109b4c0d7033df50e43c
Date of commit:
2024-11-04 14:23:22 +0100
This info was generated on:
2024-11-04 14:23:40 CET+0100

Build run:
https://github.com/dataquest-dev/dspace-angular/actions/runs/11665121758

Release link:
https://github.com/dataquest-dev/dspace-angular/releases/tag/none-2024.11.11665121758 (if it does not work, then this is not an official release instance)
kosarko commented 2 weeks ago

@milanmajchrak jinej problem je, ze te to necha se prihlasit bez potvrzeni toho mailu (bez pouziti toho linku). Vyplnim nejakej mail, vratim se na /repository, pouziju stejnyho idp, stejny credentials a dostanu se dovnitr.

https://github.com/user-attachments/assets/e078f8e7-24a4-41b5-8416-9eb118a18938

kosarko commented 2 weeks ago

@milanmajchrak I'm having an issues with this, I'm stuck at a white page with running dots... See the attached video ....

@milanmajchrak tohle se chova jinak pokud mam frontend pustenej jako yarn start a yarn start:dev (v configu mam backend nastavenej na dspace-dev, beru url z mailu a akorat vymenim domenu za localhost:4000). Pri devu se to nezasekne (sice jsem taky dostal nejakej error, ale to uz muze byt ledaccos, FE na localhost link uz jsem pouzil nekolikrat...)

Pri prod se to zasekne stejne...navic v cli pak vidim:

ERROR TypeError: Invalid character in header content ["Authorization"]
    at ClientRequest.setHeader (node:_http_outgoing:651:3)
    at new ClientRequest (node:_http_client:291:14)
    at Object.request (node:https:366:10)
    at XMLHttpRequest3._sendHxxpRequest (/tmp/junk/temporary/new/dspace-angular/dist/server/main.js:7:2159782)
    at XMLHttpRequest3._sendHttp (/tmp/junk/temporary/new/dspace-angular/dist/server/main.js:7:2159599)
    at XMLHttpRequest3.send (/tmp/junk/temporary/new/dspace-angular/dist/server/main.js:7:2157723)
    at Observable2._subscribe (/tmp/junk/temporary/new/dspace-angular/dist/server/main.js:7:2813070)
    at Observable2._trySubscribe (/tmp/junk/temporary/new/dspace-angular/dist/server/main.js:7:1780333)
    at /tmp/junk/temporary/new/dspace-angular/dist/server/main.js:7:1780225
    at Object.errorContext (/tmp/junk/temporary/new/dspace-angular/dist/server/main.js:7:1985815) {
  code: 'ERR_INVALID_CHAR'

coz nevim, jestli souvisi...