Skip to content

Token authentication doesn't work for media files behind nginx proxy #1937

Closed

Description

@SchrodingersGat
  • nginx proxy redirects auth requests to /auth/
  • when using token auth (e.g. python interface or app) server returns either 302 or 403
  • token is being checked, but user information not being added to the request
  • also request is serviced before token is checked

Activity

  1. added
    api
    bug
    on Aug 10, 2021
  2. SchrodingersGat commented on Aug 10, 2021

    @SchrodingersGat
    MemberAuthor

    @lettore it took some doing but I have managed to reproduce your issue. I'm assuming you're running behind a nginx proxy, which is forwarding auth requests for media files to the inventree server.

    There was a silly bug which prevented token-based auth from working. See #1938 for a fix which should be merged soon.

  3. lettore commented on Aug 10, 2021

    @lettore

    @lettore it took some doing but I have managed to reproduce your issue. I'm assuming you're running behind a nginx proxy, which is forwarding auth requests for media files to the inventree server.

    There was a silly bug which prevented token-based auth from working. See #1938 for a fix which should be merged soon.

    Well I'm using the Ngnix proxy container as your docker compose file, in front of that I use Traefik as https proxy.
    Not sure if this can be the problem.

  4. SchrodingersGat commented on Aug 10, 2021

    @SchrodingersGat
    MemberAuthor

    The issue is (I believe) on the server side - the token auth for /media/ files is currently not working correctly

  5. SchrodingersGat commented on Aug 10, 2021

    @SchrodingersGat
    MemberAuthor

    Please pull down latest master and see if the problem is resolved on your end.

  6. lettore commented on Aug 10, 2021

    @lettore

    Please pull down latest master and see if the problem is resolved on your end.

    Solved

  7. SchrodingersGat commented on Aug 10, 2021

    @SchrodingersGat
    MemberAuthor

    Thanks for letting me know @lettore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

apibug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions