Hi all!

A little followup information regarding my problems getting
dspace-angular-beta03 up and running.  The client works if it is installed
and running on my localhost:4000 against the test api
at dspace7.4science.cloud.  Running the client on localhost on any other
port, or against my own server results in the preflight/cors errors
described below.  It all means that nobody but me can see the latest
version (it seems that nobody wants to come to my house anymore...). Sorry
this is long, so thanks in advance for reading through!!

Closer examination shows that the 403 Errors I am catching are preflight
requests from the browser.  My attempts at a fix include setting the
Access-Control-Allow-Origin="*" both in apache and in tomcat. Neither of
which helped.  What is strange is that the preflight seems to be a result
of a simple GET request, which I think should not trigger such a request,
but I'm a little out of my depth with this.  Here is the complete request
info (from Chrome in this case):


   - *General*
      - *Request URL: *https://udc-prd.lib.umn.edu/server/api/authn/status
      - *Request Method: *OPTIONS
      - *Status Code: *403 403
      - *Remote Address: *128.101.65.121:443
      - *Referrer Policy: *no-referrer-when-downgrade
   - *Response Headers*view source
      - *Cache-Control: *no-cache, no-store, max-age=0, must-revalidate
      - *Connection: *Keep-Alive
      - *Date: *Fri, 10 Jul 2020 13:39:00 GMT
      - *Expires: *0
      - *Keep-Alive: *timeout=5, max=100
      - *Pragma: *no-cache
      - *Server: *Apache/2.4.6 (Red Hat Enterprise Linux)
      OpenSSL/1.0.2k-fips mod_jk/1.2.48
      - *Strict-Transport-Security: *max-age=31536000 ; includeSubDomains
      - *Transfer-Encoding: *chunked
      - *Vary: *
      Origin,Access-Control-Request-Method,Access-Control-Request-Headers
      - *X-Content-Type-Options: *nosniff
      - *X-Frame-Options: *DENY
      - *X-XSS-Protection: *1; mode=block
   - *Request Headers*view source
      - *Accept: **/*
      - *Accept-Encoding: *gzip, deflate, br
      - *Accept-Language: *en-US,en;q=0.9
      - *Access-Control-Request-Headers: *content-type
      - *Access-Control-Request-Method: *GET
      - *Connection: *keep-alive
      - *Host: *udc-prd.lib.umn.edu
      - *Origin: *https://udc-dev.lib.umn.edu:3000
      - *Referer: *https://udc-dev.lib.umn.edu:3000/
      - *Sec-Fetch-Dest: *empty
      - *Sec-Fetch-Mode: *cors
      - *Sec-Fetch-Site: *same-site
      -
      *User-Agent: *Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5)
      AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36

and a snippet from the javascript console for the same request:

Access to XMLHttpRequest at '
https://udc-prd.lib.umn.edu/server/api/authn/status' from origin '
https://udc-dev.lib.umn.edu:3000' has been blocked by CORS policy: Response
to preflight request doesn't pass access control check: No
'Access-Control-Allow-Origin' header is present on the requested resource.


zone.js.pre-build-optimizer.js:3372 GET
https://udc-prd.lib.umn.edu/server/api/authn/status net::ERR_FAILED


And this is the result in my apache logs:

10.21.37.74 - - [10/Jul/2020:08:39:00 -0500] "OPTIONS
/server/api/authn/status HTTP/1.1" 403 20


With an identical log entry on the tomcat side:

10.21.37.74 - - [10/Jul/2020:08:39:00 -0500] "OPTIONS
/server/api/authn/status HTTP/1.1" 403 20




On Thu, Jul 9, 2020 at 7:08 AM Bill Tantzen <[email protected]> wrote:

> Sorry for cross posting, but autocomplete tricked me into posting this on
> dspace-devel...  Anyway
>
> Out of the box, my angular client works fine against the test REST
> server.  However, when I run the client against my own REST server, every
> OPTIONS request generates a response code 403. (which usually results in
> the client hanging).
>
> I think this is a problem with either my tomcat or my apache setup, but I
> have not been able to track down the cause.  (it's probably tomcat, because
> the response is initially returned there).  In terms of configuration, both
> are pretty vanilla.
>
> One interesting side note: any identical request sent via Postman succeeds
> with response code 200!  A problem with headers perhaps?
>
> I have apache version: Apache/2.4.6 (Red Hat Enterprise Linux),
> tomcat version 9.0.34
> openjdk 11.07
>
> Example errors from the java console:
> [Error] XMLHttpRequest cannot load
>   https://XXXX.lib.umn.edu/server/api/statistics/viewevents
> <https://xxxx.lib.umn.edu/server/api/statistics/viewevents> due to access
> control checks.
> [Log] Error:  – t (main.07d9b2d02aa94962fe83.js, line 1)
> t
> [Error] Object
> [Error] Failed to load resource: Preflight response is not successful
> (viewevents, line 0)
>
> And this is repeated for each and every OPTIONS request.
>
> Any ideas?
> Thanks,
> Bill
>
> --
> Human wheels spin round and round
> While the clock keeps the pace... -- John Mellencamp
> ________________________________________________________________
> Bill Tantzen    University of Minnesota Libraries
> 612-626-9949 (U of M)    612-325-1777 (cell)
>


-- 
Human wheels spin round and round
While the clock keeps the pace... -- John Mellencamp
________________________________________________________________
Bill Tantzen    University of Minnesota Libraries
612-626-9949 (U of M)    612-325-1777 (cell)

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/CADgrb7F3xcY1ggAx%3DHe_U--h1Mgbe%2BzV9Y94utkmmq7oujREhA%40mail.gmail.com.

Reply via email to