1

I am configuring an ouath2 proxy container in docker. I am using the bitnami image: https://hub.docker.com/r/bitnami/oauth2-proxy

For the oauth2 server I am using fusionauth. https://fusionauth.io/

The expected behaviour from my side is the proxy check if the session is valid on the oauth2 server, but this is not happening. The proxy save a token, and event the token is expired, the proxy still redirect the traffic, and I want to be redirected to the login page if the jwt token is expired.

This is my compose file:

version: '3'

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
    networks:
      - proxymanager
    expose:
      - "80"
      - "443"
    volumes:
      - /home/CDF/services/vaultwarden/data:/data
    environment:
      SIGNUPS_DOMAINS_WHITELIST: ${SIGNUPS_DOMAINS_WHITELIST}
      DISABLE_ADMIN_TOKEN: true      
      # WEBSOCKET_ENABLED: true
      
  vaultwarden_oauth_middleware:
    image: bitnami/oauth2-proxy:7.4.0
    container_name: vaultwarden_oauth_middleware
    hostname: traefik_board_oauth_middleware
    restart: always
    networks:
      - proxymanager    
    command:
      - --http-address
      - 0.0.0.0:4180 
    environment:
      OAUTH2_PROXY_UPSTREAMS: ${OAUTH_PROXY_UPSTREAMS}
      OAUTH2_PROXY_PROVIDER_DISPLAY_NAME: FreakSkull
      OAUTH2_PROXY_PROVIDER: oidc
      OAUTH2_PROXY_OIDC_ISSUER_URL: ${OAUTH_PROXY_OIDC_ISSUER_URL}
      OAUTH2_PROXY_CLIENT_ID: ${OAUTH_PROXY_CLIENT_ID}
      OAUTH2_PROXY_CLIENT_SECRET: ${OAUTH_PROXY_CLIENT_SECRET}
      OAUTH2_PROXY_PASS_ACCESS_TOKEN: true 
      OAUTH2_PROXY_EMAIL_DOMAINS: '*'
      OAUTH2_PROXY_SKIP_PROVIDER_BUTTON: true 
      OAUTH2_PROXY_REDIRECT_URL: https://vaultwarden.freakskull.com/oauth2/callback
      OAUTH2_PROXY_COOKIE_SECURE: true 
      OAUTH2_PROXY_COOKIE_SECRET: ${OAUTH_PROXY_COOKIE_SECRET}
      OAUTH2_PROXY_WHITELIST_DOMAINS: '*'

    expose:
      - "4180"

networks:
  proxymanager:
    name: proxymanager
    external: true

0 Answers0