oxyno-zeta / s3-proxy

S3 Reverse Proxy with GET, PUT and DELETE methods and authentication (OpenID Connect and Basic Auth)
https://oxyno-zeta.github.io/s3-proxy/
Apache License 2.0
292 stars 33 forks source link

How to integrate with an SPA using a bearer token #403

Closed fostermi closed 8 months ago

fostermi commented 8 months ago

We have a Single Page App written in Angular that is also an OIDC client. The user hits the target URL, is redirected to the SSO (in our case Keycloak), logs in and is redirected back to the SPA. From there we have different menu items the app uses to pull in data via an Apache proxy running mod_auth_openidc by requesting a token from KC and then adding that token in a header that mod_auth_openidc can parse, validate and authorize the request based off of the claims in the token.

Is it possible to configure s3-proxy to do something similar? That is, be called in a restful way and validate a token presented to it by the SPA? This would be done without any kind of browser redirection as the URL protected by s3-proxy is not meant to be accessed directly.

fostermi commented 8 months ago

Please ignore this. It works by setting the Authorization: header with the token. I forgot that I had tested this many months ago.

fostermi commented 8 months ago

Closing