Project: OAuth2 Proxy (Provisioning / Key Management)
File: CHANGELOG.md

pkg/http: Fix leaky test (@isodude) Allow username authentication to Redis cluster (@rossigee) Log error details when failed loading CSRF cookie (@charvadzo) Update dependencies (@vllvll) Added Azure China (and other air gaped cloud) support (@mblaschke) adds an option to append CA certificates (@emsixteeen) Update dependencies (@vllvll) Add possibility to encode the state param as UrlEncodedBase64 (@brezinajn) Upgrade golang.org/x/net to v0.17.0 (@pierluigilenoci) Improve the Nginx auth_request example (@akunzai) Fixed checking Google Groups membership using Google Application Credentials (@kvanzuijlen) Allowing relative redirect url though an option (@axel7083) Add support for unix socker as upstream (@babs) Add `--backend-logout-url` with `{id_token}` placeholder (@babs) Allow cookie names with dots in redis sessions (@miguelborges99) Add nightly build and push (@tuunit) Add an option to skip request to profile URL for resolving missing claims in id_token (@nilsgstrabo) bugfix: OIDCConfig based providers are not respecting flags and configs (@tuunit) chore: Added checksums for .tar.gz (@kvanzuijlen) Added support for semicolons in query strings. (@timwsuqld) Add GitHub groups (orgs/teams) support. Including `X-Forwarded-Groups` header (@tuunit) Remove nsswitch DNS resolution workaround (@tuunit) Change base-image to (@kvanzuijlen) Update go-jose dependency (@dasvh) Update ojg to latest release (@bitfehler) Added support for env variables in the alpha struct (@hevans-dglcom) Bump golang to 1.21 and min allowed version to 1.20 (@tuunit) Several bugs have been squashed Vulnerabilities have been addressed Improved docs This release includes fixes for a number of CVEs, we recommend to upgrade as soon as possible. The environment variable OAUTH2PROXYGOOGLEGROUP has been deprecated in favor of OAUTH2PROXYGOOGLEGROUPS. Next major release will remove this option. This change makes sure that the configuration options follow the documentation. N/A Added binary and docker release platforms (@kvanzuijlen) Backwards compatible fix for wrong environment variable name (OAUTH2PROXYGOOGLE_GROUPS) (@kvanzuijlen) Fix default scope for keycloak-oidc provider (@tuunit) Upgrade alpine to version 3.18 (@polarctos) Improved session documentation (@lathspell) bugfix: default scopes for OIDCProvider based providers (@tuunit) Fix Gitea token validation (@tuunit) Several bugs have been squashed Vulnerabilities have been addressed Added a readiness endpoint to check if the application is ready to receive traffic Google Application Default Credentials support (i.e. for running on Google Cloud Platform) Session cookie support This release includes fixes for a number of CVEs, we recommend to upgrade as soon as possible. This release was pushed with the wrong Docker platform type for arm64/armv8. Use v7.5.1 instead. This release introduced a bug with the Keycloak OIDC provider causing no scopes to be send along with the request. Use v7.5.1 instead. The following PR introduces a change to how auth routes are evaluated using the flags `skip-auth-route`/`skip-auth-regex`. The new behaviour uses the regex you specify to evaluate the full path including query parameters. For more details please read the detailed description Use X-Forwarded-Uri if it exists for pathRegex match (@mzndr / @jawys) Update golang.org/x/net to v0.7.0 ato address GHSA-vvpx-j8f3-3w6h (@amrmahdi) Fix empty users with some OIDC providers (@babs) Make `htpasswd.GetUsers` racecondition safe (@babs) Ensure v8 manifest variant is set on docker images (@braunsonm) Fix PKCE code verifier generation to never use UTF-8 characters (@braunsonm) Add readiness checks for deeper health checks (@kobim) Fix default scope settings for none oidc providers (@tuunit) Add session cookie support (@t-katsumura @tanuki884) Fix validate URL, check if query string marker (?) or separator (&) needs to be appended (@miguelborges99) Make sure emailClaim is not overriden if userIDClaim is not set (@mdreem) Log the difference between invalid email and not authorized session (@omBratteng) Ensure sign-in page background is uniform throughout the page (@corybolar) Upgrade alpine to version

and library dependencies (@miguelborges99) CVE-2022-41717: DoS in Go net/http may lead to DoS (@miguelborges99) Added support for GKE Workload Identity (@kvanzuijlen) Check jsonpath syntax before interpretation (@eloo-abi) Embed static stylesheets and dependencies (@corybolar) New Azure groups support for Azure OAuth2 v2.0 Option to configure API routes - paths that will not redirect to login when unauthenticated CSRF and session cookies now have different timeouts Enable different CSRF cookies per request (@miguelborges99) Since the CSRF cookie name is now longer it could potentially break long cookie names (around 1000 characters). Having a unique CSRF cookie per request can lead to quite a number of cookies, in case an application performs a high number of parallel authentication requests. Each call will redirect to /oauth2/start, if the user is not authenticated, and a new cookie will be set. The successfully authenticated requests will have its CSRF cookies immediatly expired, however the failed ones will mantain its CSRF cookies until they expire (by default in 15 minutes). The user may redefine the CSRF cookie expiration time using flag "--cookie-csrf-expire" (e.g. --cookie-csrf-expire=5m). By default, it is 15 minutes, but you can fine tune to your environment. Add Azure groups support and Azure OAuth v2.0 (@adriananeci) group membership check is now validated while using the the azure provider. Azure OAuth v2.0 (https://login.microsoftonline.com/{tenant_id}/v2.0) is now available along with Azure OAuth v1.0. See https://github.com/oauth2-proxy/oauth2-proxy/blob/master/docs/docs/configuration/auth.md#azure-auth-provider for more details When using v2.0 Azure Auth endpoint (`https://login.microsoftonline.com/{tenant-id}/v2.0`) as `--oidcissuerurl`, in conjunction with `--resource` flag, be sure to append `/.default` at the end of the resource name. See https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent#the-default-scope for more details. This release includes fixes for a number of CVEs, we recommend to upgrade as soon as possible. N/A Update dependencies (@JoelSpeed) call providerData.setProviderDefaults for oidc provider to achieve consistent behaviour (@centzilius) UserClaim will be set to sub instead of beeing empty from now on. Fix Redis IdleTimeout when Redis timeout option is set to non-zero (@dimss) Fix method deprecated error in lint (@t-katsumura) Watch the htpasswd file for changes and update the htpasswdMap (@aiciobanu) Show an alert message when basic auth credentials are invalid (@aiciobanu) Added ability to specify allowed TLS cipher suites. (@crbednarz) Extract roles from authToken, to allow using allowed roles with Keycloak. (@MrDeerly ) Fix vulnerabilities CVE-2022-27191, CVE-2021-44716 and CVE-2022-29526. (@felipeconti) Rename configuration file flag for PKCE (@ChrisEke) to remain consistent with CLI flags. You should specify `codechallengemethod` in your configuration instead of `forcecodechallenge_method`. Enable different CSRF cookies per request (@miguelborges99) Add flag "--cookie-csrf-per-request" which activates an algorithm to name CSRF cookies differently per request. This feature allows parallel callbacks and by default it is disabled. Add flag "--cookie-csrf-expire" to define a different expiration time for the CSRF cookie. By default, it is 15 minutes. Support negating for skip auth routes (@ianldge) Update base docker image to alpine 3.16 (@tooptoop4) Option to configure API routes (@segfault16) Fix vulnerabilities CVE-2022-32149 and CVE-2022-27664. (@crbednarz) Fix Nextcloud provider (@n1tehawk) Add Azure groups support and Azure OAuth v2.0 (@adriananeci) Bump golang to 1.19 and min allowed version to 1.18 (@adriananeci) Keycloak: save user and preferredUsername in session to populate headers for the backend (@babs) Update go-redis/redis to v9 (@arhamGH) PKCE Code Challenge Support - RFC-7636 (@braunsonm) At this time the `--code-challenge-method` flag can be used to enable it with the method of your choice. Parital support for OAuth2 Authorization Server Metadata for detecting code challenge methods (@braunsonm) A warning will be displayed when your provider advertises support for PKCE but you have not enabled

Support for the ARMv8 and ppc64le architectures Configurable upstream request timeouts separate image tags for each architecture is deprecated. Instead, images are cross compiled and pushed as the same tag for every platform. If you are using an architecture specific tag (ex: v7.2.1-arm64) you should move to the generic tag instead (ex: v7.2.1 ) Changes the UID and GID of the runtime user to `65532`. Which also is known as `nonroot` user in . This release includes fixes for a number of CVEs, we recomend to upgrade as soon as possible. Azure provider breaks after upgrading to this version. Please see the issue for more details. Discover signature algorithms from OIDC provider (@JoelSpeed) Updated go-lang's text, crypto and prometheus dependencies to fix reported security vulnerabilities. (@rkkris75) Add optional `allowedemails` query parameter to the `authrequest`. (@zv0n) Parameterise the runtime image (@omBratteng) Add groups to session too when creating session from bearer token (@adriananeci) Support for passing arbitrary query parameters through from `/oauth2/start` to the identity provider's login URL. Configuration settings control which parameters are passed by default and precisely which values can be overridden per-request (@ianroberts) Introduce ProviderVerifier to clean up OIDC discovery code (@JoelSpeed) Add ppc64le support (@mgiessing) Ensure claim extractor does not attempt profile call when URL is empty (@JoelSpeed) Fix provider data initialisation (@JoelSpeed) Refactor provider configuration into providers package (@JoelSpeed) Add generic claim extractor to get claims from ID Tokens (@JoelSpeed) Implement session locking with session state lock (@JoelSpeed, @Bibob7) Fix Docker Buildx push to include build version (@JoelSpeed) Remove provider documentation for `Microsoft Azure AD` (@omBratteng) Added configuration for audience claim (`--oidc-extra-audience`) and ability to specify extra audiences (`--oidc-extra-audience`) allowed passing audience verification. This enables support for AWS Cognito and other issuers that have custom audience claims. Also, this adds the ability to allow multiple audiences. (@kschu91) Update LoginGovProvider ValidateSession to pass access_token in Header (@pksheldon4) Support configuration of minimal acceptable TLS version (@polarctos) Fix issue with query string allowed group panic on skip methods (@andytson) Add the `allowedemaildomains` and the `allowedgroups` on the `authrequest` + support standard wildcard char for validation with sub-domain and email-domain. (@w3st3ry @armandpicard) PKCE Code Challenge Support - RFC-7636 (@braunsonm) Release ARMv8 docker images (@braunsonm) Return a 400 instead of a 500 when a request contains an invalid redirect target (@niksko) Implement configurable upstream timeout (@jacksgt) Fixed 500 when checking if user has repo (@adamsong) Added description and unit tests for ipv6 address (@t-katsumura) Unbreak oauth2-proxy for keycloak provider after 2c668a (@ckwalsh) This release contains a number of bug and security fixes, but has no feature additions. N/A N/A Use `upn` claim consistently in ADFSProvider (@NickMeves) Fix docker build/push issues found during last release (@JoelSpeed) Let authentication fail when session validation fails (@stippi2) Fix docker container multi arch build issue by passing GOARCH details to make build (@jkandasa) Update LinkedIn provider validate URL (@jkandasa) Update alpine to 3.15 (@AlexanderBabel) Update to Go 1.17 (@polarctos) LinkedIn provider updated to support the new v2 API Introduce `--force-json-errors` to allow OAuth2 Proxy to protect JSON APIs and disable authentication redirection Add URL rewrite capabilities to the upstream proxy New ADFS provider integration New Keycloak OIDC provider integration Introduced Multiarch Docker images on the standard image tags The extra validation to protect invalid session deserialization from v6.0.0 (only) has been removed to improve performance. If you are on v6.0.0, either upgrade to a version before this first and allow legacy sessions to expire gracefully or change your `cookie-secret` value and force all sessions to reauthenticate. A new `keycloak-oidc` provider has been added with support for role based

The existing keycloak auth provider will eventually be deprecated and removed. Please switch to the new provider `keycloak-oidc`. GitLab groups sent in the `X-Forwarded-Groups` header to the upstream server will no longer be prefixed with `group:` Improve build times by sharing cache and allowing platform selection (@JoelSpeed) Improve error message when no cookie is found (@JoelSpeed) linkedin: Update provider to v2 (@wuurrd) Using the native httputil proxy code for websockets rather than yhat/wsutil to properly handle HTTP-level failures (@thetrime) Fix the manual sign in with --htpasswd-user-group switch (@janrotter) Added `--force-json-errors` flag (@bancek) Changing user field type to text when using htpasswd (@pburgisser) Base GitLab provider implementation on OIDCProvider (@NickMeves) Update crypto and switched to new github.com/golang-jwt/jwt (@JVecsei) Update go-oidc to v3 (@NickMeves) Extend email-domain validation with sub-domain capability (@morarucostel) Implement RewriteTarget to allow requests to be rewritten before proxying to upstream servers (@JoelSpeed) Refresh sessions before token expiration if configured (@NickMeves) Move app redirection logic to its own package (@JoelSpeed) Use gorilla mux for OAuth Proxy routing (@JoelSpeed) Added ADFS provider (@samirachoadi) Fix Refresh Session not working for multiple cookies (@rishi1111) Add Redis lock feature to lock persistent sessions (@Bibob7) Add alternative ways to generate cookie secrets to docs (@JoelSpeed) Add pagewriter to upstream proxy (@JoelSpeed) Fix incorrect `cfg` name in show-debug-on-error flag (@iTaybb) Fix URI fragment handling on sign-in page, regression introduced in 7.1.0 (@tarvip) New Keycloak OIDC Provider (@pb82) Update Alpine image version to 3.14 (@ahovgaard) Fix incorrect `</form>` tag on the sing_in page when not using a custom template (@jord1e) Allow specifying URL as input for custom sign in logo (@MaikuMori) Fix unsafe access to session variable (@harzallah) Allow passing the raw url path when proxying upstream requests - e.g. /%2F/ (@FStelzer) Multiarch support for docker image (@goshlanguage) Fixed `panic` when connecting to Redis with TLS (@mstrzele) Improve TLS handling for Redis to support non-standalone mode with TLS (@wadahiro) Fixed typos in the metrics server TLS config names `--insecure-oidc-skip-nonce` is currently `true` by default in case any existing OIDC Identity Providers don't support it. The default will switch to `false` in a future version. Fix incorrect `cfg` name in Metrics TLS flags (@NickMeves) Set & verify a nonce with OIDC providers (@NickMeves) Add clock package for better time mocking in tests (@NickMeves) Multiple provider ingestion and validation in alpha options (first stage: ) (@yanasega) Metrics bind address initialisation was broken in config files N/A N/A Rewrite OpenRedirect tests in ginkgo (@JoelSpeed) Remove unused fields from OAuthProxy (@JoelSpeed) Fix metrics server bind address initialization (@oliver006) The metrics server could not be started in v7.1.0, this is now fixed. N/A N/A Metrics server should be constructed with secure bind address for TLS (@JoelSpeed) New improved design for sign in and error pages based on bulma framework Refactored templates loading `robots.txt`, `sign_in.html` and `error.html` can now be provided individually in `--custom-templates-dir` If any of the above are not provided, defaults are used Defaults templates be found in Introduction of basic prometheus metrics Introduction of Traefik based local testing/example environment Support for request IDs to allow request co-ordination of log lines GitLab group authorization stopped working in v7.0.0, the functionality has now been restored, please see the linked advisory for details Upstream request signatures via `--signature-key` is deprecated. Support will be removed completely in v8.0.0. The default logging templates have been updated to include {{.RequestID}} The `--gcp-healthchecks` option is now deprecated. It will be removed in a future release. To migrate, you can change your application health checks for OAuth2 Proxy to point to the `--ping-path`

You can also migrate the user agent based health check using the `--ping-user-agent` option. Set it to `GoogleHC/1.0` to allow health checks on the path `/` from the Google health checker. N/A `--gitlab-group` GitLab Group Authorization config flag stopped working in v7.0.0 (@NickMeves, @papey) Panic with GitLab project repository auth (@piersharding) Reinstate preferEmailToUser behaviour for basic auth sessions (@JoelSpeed) Fix upstream proxy appending ? to requests (@JoelSpeed) Deprecate GCP HealthCheck option (@JoelSpeed) Allow custom robots text pages (@JoelSpeed) Ensure redirect URI always has a scheme (@JoelSpeed) Deprecate upstream request signatures (@NickMeves) Support Request ID in logging (@NickMeves) Extract email from id_token for azure provider when oidc is configured (@weinong) Refactor HTTP Server and add ServerGroup to handle graceful shutdown of multiple servers (@JoelSpeed) Refactor logging middleware to middleware package (@NickMeves) Add support for setting groups on session when using basic auth (@stefansedich) Add option for custom logos on the sign in page (@JoelSpeed) Update to Go 1.16 (@JoelSpeed) Update golangci-lint to latest version (v1.36.0) (@JoelSpeed) Refactor Sign In Page rendering and capture all page rendering code in pagewriter package (@JoelSpeed) Refactor error page rendering and allow debug messages on error (@JoelSpeed) Refactor templates, update theme and provide styled error pages (@JoelSpeed) Ensure errors in tests are logged to the GinkgoWriter (@JoelSpeed) Add Prometheus metrics endpoint (@neuralsandwich) Update docs on Traefik ForwardAuth support without the use of Traefik 'errors' middleware (@pcneo83) Add an example with Traefik (configuration without Traefik 'errors' middleware) (@fcollonval) Fixed a bug that meant that flag ordering mattered Fixed a bug where response headers for groups were not being flattened N/A N/A Flatten array-based response headers (@NickMeves) Ensure config flags get parsed correctly when other flags precede them (@JoelSpeed) Major internal improvements to provider interfaces Added group authorization support Improved support for external auth for Traefik Introduced alpha configuration format to allow users to trial new configuration format and alpha features GitLab provider now supports restricting to members of a project Keycloak provider now supports restricting users to members of a set of groups (Alpha) Flexible header configuration allowing user defined mapping of session claims to header values The whitelist domain feature has been updated to fix a vulnerability that was identified, please see the linked advisory for details Redirect URL generation will attempt secondary strategies in the priority chain if any fail the `IsValidRedirect` security check. Previously any failures fell back to `/`. Keycloak will now use `--profile-url` if set for the userinfo endpoint instead of `--validate-url`. `--validate-url` will still work for backwards compatibility. To use X-Forwarded-{Proto,Host,Uri} on redirect detection, `--reverse-proxy` must be `true`. `--user-id-claim` option is deprecated and replaced by `--oidc-email-claim` Gitlab projects needs a Gitlab application with the extra `read_api` enabled `/oauth2/auth` `allowed_groups` querystring parameter can be paired with the `allowed-groups` configuration option. The `allowed_groups` querystring parameter can specify multiple comma delimited groups. In this scenario, the user must have a group (from their multiple groups) present in both lists to not get a 401 or 403 response code. Example: OAuth2-Proxy globally sets the `allowed_groups` as `engineering`. An application using Kubernetes ingress uses the `/oauth2/auth` endpoint with `allowed_groups` querystring set to `backend`. A user must have a session with the groups `["engineering", "backend"]` to pass authorization. Another user with the groups `["engineering", "frontend"]` would fail the querystring authorization portion. Existing sessions from v6.0.0 or earlier are no longer valid. They will trigger a reauthentication. `skip-auth-strip-headers` now applies to all requests, not just those where authentication would be

The behavior of the Google provider Groups restriction changes with this Either `--google-group` or the new `--allowed-group` will work for Google now (`--google-group` will be used if both are set) Group membership lists will be passed to the backend with the `X-Forwarded-Groups` header If you change the list of allowed groups, existing sessions that now don't have a valid group will be logged out immediately. Previously, group membership was only checked on session creation and refresh. `--skip-auth-route` is (almost) backwards compatible with `--skip-auth-regex` We are marking `--skip-auth-regex` as DEPRECATED and will remove it in the next major version. If your regex contains an `=` and you want it for all methods, you will need to add a leading `=` (this is the area where `--skip-auth-regex` doesn't port perfectly) Sessions from v5.1.1 or earlier will no longer validate since they were not signed with SHA1. Sessions from v6.0.0 or later had a graceful conversion to SHA256 that resulted in no reauthentication Upgrading from v5.1.1 or earlier will result in a reauthentication Ensure you have configured oauth2-proxy to use the `groups` scope. The user may be logged out initially as they may not currently have the `groups` claim however after going back through login process wil be authenticated. Enables complex data structures for group claim entries, which are output as Json by default. `--reverse-proxy` must be true to trust `X-Forwarded-*` headers as canonical. These are used throughout the application in redirect URLs, cookie domains and host logging logic. These are the headers: `X-Forwarded-Proto` instead of `req.URL.Scheme` `X-Forwarded-Host` instead of `req.Host` `X-Forwarded-Uri` instead of `req.URL.RequestURI()` In config files & envvar configs, `keycloakgroup` is now the plural `keycloakgroups`. Flag configs are still `--keycloak-group` but it can be passed multiple times. Specifying a non-existent provider will cause OAuth2-Proxy to fail on startup instead of defaulting to "google". Security changes to Google provider group authorization flow If you change the list of allowed groups, existing sessions that now don't have a valid group will be logged out immediately. Previously, group membership was only checked on session creation and refresh. When a Redis session store is configured, OAuth2-Proxy will fail to start up unless connection and health checks to Redis pass Fix import path for v7. The import path has changed to support the go get installation. You can now `go get github.com/oauth2-proxy/oauth2-proxy/v7` to get the latest `v7` version of OAuth2 Proxy Import paths for package are now under `v7`, eg `github.com/oauth2-proxy/oauth2-proxy/v7/pkg/<module>` A bug in the Azure provider prevented it from properly passing the configured protected `--resource` via the login url. If this option was used in the past, behavior will change with this release as it will affect the tokens returned by Azure. In the past, the tokens were always for `https://graph.microsoft.com` (the default) and will now be for the configured resource (if it exists, otherwise it will run into errors) The Azure provider now has token refresh functionality implemented. This means that there won't be any redirects in the browser anymore when tokens expire, but instead a token refresh is initiated in the background, which leads to new tokens being returned in the cookies. Please note that `--cookie-refresh` must be 0 (the default) or equal to the token lifespan configured in Azure AD to make Azure token refresh reliable. Setting this value to 0 means that it relies on the provider implementation to decide if a refresh is

Subdomain checking of whitelisted domains could allow unintended redirects (@NickMeves) Use logger for logging refreshed session in azure and gitlab provider (@Bibob7) Use comma separated multiple values for header (@lilida) Add docs and generated reference for Alpha configuration (@JoelSpeed) Add Security Policy (@JoelSpeed) Require `--reverse-proxy` true to trust `X-Forwareded-*` type headers (@NickMeves) Fix joined cookie name for those containing underline in the suffix (@peppered) Migrate Keycloak to EnrichSession & support multiple groups for authorization (@NickMeves) Use X-Forwarded-{Proto,Host,Uri} on redirect as last resort (@linuxgemini) Add support for Gitlab project based authentication (@factorysh) Introduce alpha configuration option to enable testing of structured configuration (@JoelSpeed) Cleanup missed provider renaming refactor methods (@NickMeves) (via ) Support non-list group claims (@loafoe) Refactor OIDC Provider and support groups from Profile URL (@NickMeves) Streamline provider interface method names and signatures (@NickMeves) Support group authorization on `oauth2/auth` endpoint via `allowed_groups` querystring (@NickMeves) Fix basic auth legacy header conversion (@JoelSpeed) Add AlphaOptions struct to prepare for alpha config loading (@JoelSpeed) Support TLS 1.3 (@aajisaka) Fix log header output (@JoelSpeed) Validate provider type on startup. (@arcivanov) Set up v6.1.x versioned documentation as default documentation (@JoelSpeed) Remove v5 legacy sessions support (@NickMeves) Set `skip-auth-strip-headers` to `true` by default (@NickMeves) Integrate new header injectors into project (@JoelSpeed) Create universal Authorization behavior across providers (@NickMeves) Migrate documentation to Docusaurus (@JoelSpeed) Azure token refresh (@codablock) Increase session fields in `/oauth2/userinfo` endpoint (@NickMeves) Fix code coverage reporting on GitHub actions(@JoelSpeed) Deprecate GetUserName & GetEmailAdress for EnrichSessionState (@NickMeves) Add generic Header injectors for upstream request and response headers (@JoelSpeed) Pass resource parameter in login url (@codablock) Add `--skip-auth-route` configuration option for `METHOD=pathRegex` based allowlists (@NickMeves) Stop accepting legacy SHA1 signed cookies (@NickMeves) Validate Redis configuration options at startup (@NickMeves) Remove GetPreferredUsername method from provider interface (@NickMeves) Document bcrypt encryption for htpasswd (and hide SHA) (@lentzi90) Use display-htpasswd-form flag Add support to ensure user belongs in required groups when using the OIDC provider (@stefansedich) Fix import path for v7 (@johejo) Update Go to 1.15 (@johejo) Fix build (@thiagocaiubi) Update go-redis/redis to v8 (@johejo) ci: Migrate to Github Actions (@shinebayar-g) Rename test directory to testdata (@johejo) Improve CI (@johejo) Adapt isAjax to support mimetype lists (@rassie) Update alpine version to

(@nishanth-pinnapareddy) Fixed a bug which prevented static upstreams from being used Fixed a bug which prevented file based upstreams from being used Ensure that X-Forwarded-Host is respected consistently N/A N/A Use X-Forwarded-Host consistently when set (@NickMeves) Fix conversion of static responses in upstreams (@JoelSpeed) Redis session stores now support authenticated connections Error logging can now be separated from info logging by directing error logs to stderr Added --session-cookie-minimal flag which helps prevent large session cookies Improvements to force-https behaviour Allow requests to skip authentication based on their source IP There is backwards compatibility to sessions from v5 Any unencrypted sessions from before v5 that only contained a Username & Email will trigger a reauthentication Only log no cookie match if cookie domains specified (@JoelSpeed) Create generic Authorization Header constructor (@JoelSpeed) Ensure session times are not nil before printing them (@JoelSpeed) Support passwords with Redis session stores (@NickMeves) Add Gosec fixes to areas that are intermittently flagged on PRs (@NickMeves) Allow Logging to stdout with separate Error Log Channel Address GoSec security findings & remediate (@NickMeves) Fix finicky logginghandlertest from time drift (@NickMeves) Allow OIDC Bearer auth IDTokens to have empty email claim & profile URL (@NickMeves) Align persistence ginkgo tests with conventions (@NickMeves) Preserve query when building redirect Refactor provider URLs to package level vars (@JoelSpeed) Refactor persistent session store session ticket management (@NickMeves) Refactor session loading to make use of middleware pattern (@JoelSpeed) Integrate upstream package with OAuth2 Proxy (@JoelSpeed) Refactor HTPasswd Validator (@JoelSpeed) Allow stripping authentication headers from whitelisted requests with `--skip-auth-strip-headers` (@NickMeves) Add --session-cookie-minimal option to create session cookies with no tokens (@NickMeves) Reduce session size by encoding with MessagePack and using LZ4 compression (@NickMeves) Fix required ruby version and deprecated option for building docs (@mkontani) Reduce docker context to improve build times (@JoelSpeed) Use req.Host in --force-https when req.URL.Host is empty (@zucaritask) Use builder pattern to simplify requests to external endpoints (@JoelSpeed) Introduce upstream package with new reverse proxy implementation (@JoelSpeed) Separate Cookie validation out of main options validation (@JoelSpeed) Split long session cookies more precisely (@NickMeves) Improve Redirect to HTTPs behaviour (@JoelSpeed) Close client connections after each redis test (@JoelSpeed) Move SessionStore tests to independent package (@JoelSpeed) Move Cipher and Session Store initialisation out of Validation (@JoelSpeed) Support specifying alternative provider TLS trust source(s) (@k-wall) Resolve an issue where an empty healthcheck URL and ping-user-agent returns the healthcheck response (@jordancrawfordnz) Do not add Cache-Control header to response from auth only endpoint (@johejo) Implements --trusted-ip option to allow clients behind specified IPs or CIDR ranges to bypass authentication (@Izzette) dist.sh: remove go version from asset links (@syscll) Migrated to an independent GitHub organisation Added local test environment examples using docker-compose and kind Error pages will now be rendered when upstream connections fail Non-Existent options in config files will now return errors on startup Sessions are now always encrypted, independent of configuration (Security) Fix for . More invalid redirects that lead to open-redirects were reported An extensive test suite has been added to prevent future regressions Responses to endpoints with a proxy prefix will now return headers for preventing browser caching. Migration from Pusher to independent org may have introduced breaking changes for your environment. See the changes listed below for PR for full details Binaries renamed from `oauth2_proxy` to `oauth2-proxy` Switch Azure AD Graph API to Microsoft Graph API The Azure AD Graph API has been and is being replaced by the Microsoft Graph API. If your application relies on the access token being passed to it to access the Azure AD Graph API, you should migrate your application to use the Microsoft Graph API. Existing behaviour can be retained by setting `-resource=https://graph.windows.net`. Configuration loading has been replaced with Viper and PFlag Flags now require a `--` prefix before the option Previously flags allowed either `-` or `--` to prefix the option name Eg `-provider` must now be `--provider` Switch flags to StringSlice instead of StringArray Options that take multiple arguments now split strings on commas if present Eg `--foo=a,b,c,d` would result in the values `a`, `b`, `c` and `d` instead of a single `a,b,c,d` value as before Drop support for pre v3.1 cookies The encoding for session cookies was changed starting in v3.1.0, support for the previous encoding is now dropped If you are upgrading from a version earlier than this, please upgrade via a version between v3.1.0 and v5.1.1 Drop Fallback to Email if User not set Previously, when a session was loaded, if the User was not set, it would be replaced by the Email. This behaviour was inconsistent as it required the session to be stored and then loaded to function properly. This behaviour has now been removed and the User field will remain empty if it was not set when the session was saved. In some scenarios `X-Forwarded-User` will now be empty. Use `X-Forwarded-Email` instead. In some scenarios, this may break setting Basic Auth on upstream or responses. Use `--prefer-email-to-user` to restore falling back to the Email in these

Remove unintentional auto-padding of secrets that were too short Previously, after cookie-secrets were opportunistically base64 decoded to raw bytes, they were padded to have a length divisible by 4. This led to wrong sized secrets being valid AES lengths of 16, 24, or 32 bytes. Or it led to confusing errors reporting an invalid length of 20 or 28 when the user input cookie-secret was not that length. Now we will only base64 decode a cookie-secret to raw bytes if it is 16, 24, or 32 bytes long. Otherwise, we will convert the direct cookie-secret to bytes without silent padding added. / Allow multiple cookie domains to be specified Multiple cookie domains may now be configured. The longest domain that matches will be used. The config options `cookiedomain` is now `cookiedomains` The environment variable `OAUTH2PROXYCOOKIEDOMAIN` is now `OAUTH2PROXYCOOKIEDOMAINS` Always encrypt sessions regardless of config Previously, sessions were encrypted only when certain options were configured. This lead to confusion and misconfiguration as it was not obvious when a session should be encrypted. Cookie Secrets must now be 16, 24 or 32 bytes. If you need to change your secret, this will force users to reauthenticate. Separate logging options out of main options structure Fixes an inconsistency in the `--exclude-logging-paths` option by renaming it to `--exclude-logging-option`. This flag may now be given multiple times as with other list options This flag also accepts comma separated values Change how gitlab-group is parsed on options Previously, the flag gitlab-group used comma seperated values, while the config option used space seperated values. This fixes the config value to use slices internally. The config option `gitlabgroup` is now `gitlabgroups` The environment variable `OAUTH2PROXYGITLABGROUP` is now `OAUTH2PROXYGITLABGROUPS` New OpenRedirect cases have been found (@JoelSpeed) Change how gitlab-group is parsed on options (@linuxgemini) Kubernetes example based on Kind cluster and Nginx ingress (@EvgeniGordeev) Validate Bearer IDTokens in headers with correct provider/extra JWT Verifier (@NickMeves) Add HealthCheck middleware (@JoelSpeed) Don't log invalid redirect if redirect is empty (@JoelSpeed) Add Keycloak local testing environment (@EvgeniGordeev) Refactor encryption ciphers and add AES-GCM support (@NickMeves) Ensure decrypted user/email are valid UTF8 (@JoelSpeed) Fallback to UserInfo is User ID claim not present (@JoelSpeed) acr_values no longer sent to IdP when empty (@ScottGuymer) Separate logging options out of main options structure (@JoelSpeed) Allow health/ping request to be identified via User-Agent (@chkohner) Improvements to Session State code (@JoelSpeed) Properly parse redis urls for cluster and sentinel connections (@amnay-mo) render error page on 502 proxy status (@amnay-mo) Rename cookie-domain config to cookie-domains (@JoelSpeed) Updated autocompletion for `--` long options. (@Izzette) Move Options and Validation to separate packages (@JoelSpeed) Remove unintentional auto-padding of secrets that were too short (@NickMeves) Refactor sessions/utils.go functionality to other areas (@NickMeves) Implements --real-client-ip-header option to select the header from which to obtain a proxied client's IP (@Izzette) Add local test environments for testing changes and new features (@JoelSpeed) Drop Fallback to Email if User not set (@JoelSpeed) Drop support for pre

cookies (@JoelSpeed) Set up code coverage within Travis for Code Climate (@JoelSpeed) Add basic string functions to templates (@n-i-x) Sign cookies with SHA256 (@NickMeves) Drop configure script in favour of native Makefile env and checks (@JoelSpeed) Support context in providers (@johejo) Switch flags to PFlag to remove StringArray (@JoelSpeed) Replace configuration loading with Viper (@JoelSpeed) Add `-user-id-claim` to support generic claims in addition to email (@holyjak) Add new linters (@johejo) Switch Azure AD Graph API to Microsoft Graph API (@johejo) Prevent browser caching during auth flow (@johejo) Allow OIDC issuer verification to be skipped (@chkohner) Update Okta docs (@trevorbox) Always log hasMember request error object (@jbielick) Implement graceful shutdown and propagate request context (@johejo) Migrate to oauth2-proxy/oauth2-proxy (@JoelSpeed) Project renamed from `pusher/oauth2_proxy` to `oauth2-proxy` Move Go import path from `github.com/pusher/oauth2_proxy` to `github.com/oauth2-proxy/oauth2-proxy` Remove Pusher Cloud Team from CODEOWNERS Release images moved to `quay.io/oauth2-proxy/oauth2-proxy` Binaries renamed from `oauth2_proxy` to `oauth2-proxy` Update ruby dependencies for documentation (@theobarberbany) Add logging in case of invalid redirects (@gargath) Allow HTML in banner message (@eritikass) Allow multiple cookie domains to be specified (@edahlseng) Add -set-basic-auth param to set the Basic Authorization header for upstreams (@morarucostel) Warn users when session cookies are split (@JoelSpeed) Set-Basic-Auth should default to false (@JoelSpeed) Upstream websockets TLS certificate validation now depends on ssl-upstream-insecure-skip-verify (@yaroslavros) Restrict access using Github collaborators (@jsclayton) Always encrypt sessions regardless of config (@ti-mo) Allow logins by usernames even if they do not belong to the specified org and team or collaborators (@yyoshiki41) N/A (Security) Fix for . A bad actor using encoded whitespace in redirect URIs can redirect a session to another domain N/A Fix Open Redirect Vulnerability with encoded Whitespace characters (@JoelSpeed) Bump to Go 1.14 Reduced number of Google API requests for group validation Support for Redis Cluster Support for overriding hosts in hosts file [#335] The session expiry for the OIDC provider is now taken from the Token Response (expiresin) rather than from the idtoken (exp) N/A Fix http.Cookie SameSite is not copied (@johejo) Expose `acr_values` to all providers (@holyjak) Support Go 1.14, upgrade dependencies, upgrade golangci-lint to 1.23.6 (@johejo) Support prompt in addition to approval-prompt (@holyjak) Fix issue with group validation calling google directory API on every HTTP request (@ericofusco) Add `nsswitch.conf` to Docker image to allow hosts file to work (@luketainton) Use the `Authorization` header instead of `access_token` for refreshing GitHub Provider sessions (@ibuclaw) Allow fallback to secondary verified email address in GitHub provider (@dmnemec) OIDC Provider support for empty id_tokens in the access token refresh response (@howzat) Extension of Redis Session Store to Support Redis Cluster (@yan-dblinf) Fix login page fragment handling after soft reload on Firefox (@ffdybuster) Add Client Secret File support for providers that rotate client secret via file system (@pasha-r) Give the option to pass email address in the Basic auth header instead of upstream usernames. (@Spindel) The `/sign_in` page now honors the `rd` query parameter, fixing the redirect after a successful authentication (@ti-mo) Give the option to prefer email address in the username header when using the -pass-user-headers option (@jordancrawfordnz) Disabled CGO (binaries will work regardless og glibc/musl) Allow whitelisted redirect ports Nextcloud provider support added DigitalOcean provider support added (Security) Fix for .. a bad actor using `/\` in redirect URIs can redirect a session to another domain Add reverse proxy boolean flag to control whether headers like `X-Real-Ip` are accepted. This defaults to false. Usage behind a reverse proxy will require this flag to be set to avoid logging the reverse proxy IP address. Add reverse proxy setting (@martin-css) Build with CGO=0 (@tomelliff) Add configuration for cookie 'SameSite' value. (@pgroudas) Update keycloak provider configuration documentation. (@sushiMix) dist.sh: use sha256sum (@syscll) Add Nextcloud provider (@Ramblurr) whitelisted redirect domains: add support for whitelisting specific ports or allowing wildcard ports (@kamaln7) Add DigitalOcean Auth provider (@kamaln7) Added Keycloak provider Build on Go 1.13 Upgrade Docker image to use Debian Buster Added support for FreeBSD builds Added new logo Added support for GitHub teams N/A N/A Added bash >=

dependency to configure script (@jmfrank63) Add Keycloak provider (@Ofinka) Redirect to HTTPS (@jmickey) Support Go 1.13 (@dio) docker: build from debian buster (@syscll) Add IDToken for Azure provider (@leyshon) This PR adds the IDToken into the session for the Azure provider allowing requests to a backend to be identified as a specific user. As a consequence, if you are using a cookie to store the session the cookie will now exceed the 4kb size limit and be split into multiple cookies. This can cause problems when using nginx as a proxy, resulting in no cookie being passed at all. Either increase the proxybuffersize in nginx or implement the redis session storage (see https://oauth2-proxy.github.io/oauth2-proxy/configuration#redis-storage) Requests.go updated with useful error messages (@biotom) Supports many github teams with api pagination support (@toshi-miura, @apratina) Rewrite dist script (@syscll) Add new Logo! :tada: (@JoelSpeed) Added userinfo endpoint (@kbabuadze) Added support for custom CA when connecting to Redis cache (@lleszczu) Fix issue with X-Auth-Request-Redirect header being ignored (@webnard) Add redirect capability to sign_out (@costelmoraru) Add upstream with static response (@cgroschupp) Add build for FreeBSD (@fnkr) Allow to override provider's name for sign-in page (@ffdybuster) Documentation is now on a Health check logging can now be disabled for quieter logs Authorization Header JWTs can now be verified by the proxy to skip authentication for machine users Sessions can now be stored in Redis. This reduces refresh failures and uses smaller cookies (Recommended for those using OIDC refreshing) Logging overhaul allows customisable logging formats This release includes a number of breaking changes that will require users to reconfigure their proxies. Please read the Breaking Changes below thoroughly. Rework GitLab provider This PR changes the configuration options for the GitLab provider to use a self-hosted instance. You now need to specify a `-oidc-issuer-url` rather than explicit `-login-url`, `-redeem-url` and `-validate-url` parameters. Make config consistent This PR changes configuration options so that all flags have a config counterpart of the same name but with underscores (`_`) in place of hyphens (`-`). This change affects the following flags: The `--tls-key` flag is now `--tls-key-file` to be consistent with existing file flags and the existing config and environment settings The `--tls-cert` flag is now `--tls-cert-file` to be consistent with existing file flags and the existing config and environment settings This change affects the following existing configuration options: The `proxy-prefix` option is now `proxy_prefix`. This PR changes environment variables so that all flags have an environment counterpart of the same name but capitalised, with underscores (`_`) in place of hyphens (`-`) and with the prefix `OAUTH2PROXY`. This change affects the following existing environment variables: The `OAUTH2SKIPOIDCDISCOVERY` environment variable is now `OAUTH2PROXYSKIPOIDC_DISCOVERY`. The `OAUTH2OIDCJWKSURL` environment variable is now `OAUTH2PROXYOIDCJWKS_URL`. Use full email address as `User` if the auth response did not contain a `User` field This change modifies the contents of the `X-Forwarded-User` header supplied by the proxy for users where the auth response from the IdP did not contain a username. In that case, this header used to only contain the local part of the user's email address (e.g. `john.doe` for `john.doe@example.com`) but now contains the user's full email address instead. Pre-built binary tarballs changed format The pre-built binary tarballs again match the format of the repository, where the unpacked directory has the same name as the tarball and the binary is always named `oauth2_proxy`. This was done to restore compatibility with third-party automation recipes like

Added option `-ssl-upstream-insecure-skip-validation` to skip validation of upstream SSL certificates (@jansinger) Check Google group membership using hasMember to support nested groups and external users (@jpalpant) Add optional group membership and email domain checks to the GitLab provider (@Overv) Made setting of proxied headers deterministic based on configuration alone (@aeijdenberg) Add Silence Ping Logging and Exclude Logging Paths flags (@kskewes) Improve docker build caching of layers (@dekimsey) Make config consistent (@JoelSpeed) Move root packages to pkg folder (@JoelSpeed) Improvements to authenticate requests with a JWT bearer token in the `Authorization` header via the `-skip-jwt-bearer-token` options. (@brianv0) Additional verifiers can be configured via the `-extra-jwt-issuers` flag if the JWT issuers is either an OpenID provider or has a JWKS URL (e.g. `https://example.com/.well-known/jwks.json`). Minor refactor of core proxying path (@aeijdenberg). Bump go-oidc to v2.0.0 (@aeijdenberg). Includes fix for potential signature checking issue when OIDC discovery is skipped. Add RedisSessionStore implementation (@brianv0, @JoelSpeed) Implement flags to configure the redis session store `-session-store-type=redis` Sets the store type to redis `-redis-connection-url` Sets the Redis connection URL `-redis-use-sentinel=true` Enables Redis Sentinel support `-redis-sentinel-master-name` Sets the Sentinel master name, if sentinel is enabled `-redis-sentinel-connection-urls` Defines the Redis Sentinel Connection URLs, if sentinel is enabled Introduces the concept of a session ticket. Tickets are composed of the cookie name, a session ID, and a secret. Redis Sessions are stored encrypted with a per-session secret Added tests for server based session stores Drop Go 1.11 support in Travis (@JoelSpeed) Update Alpine to 3.9 (@kskewes) Implement SessionStore interface within proxy (@JoelSpeed) Add SessionStore interfaces and initial implementation (@JoelSpeed) Allows for multiple different session storage implementations including client and server side Adds tests suite for interface to ensure consistency across implementations Refactor some configuration options (around cookies) into packages , Documentation is now available live at our (@JoelSpeed, @icelynjennings) Use full email address as `User` if the auth response did not contain a `User` field (@gargath) Use GO 1.12 for ARM builds (@kskewes) ARM Docker USER fix (@kskewes) Logging Improvements (@MisterWil) Implement flags to configure file logging `-logging-filename` Defines the filename to log to `-logging-max-size` Defines the maximum `-logging-max-age` Defines the maximum age of backups to retain `-logging-max-backups` Defines the maximum number of rollover log files to retain `-logging-compress` Defines if rollover log files should be compressed `-logging-local-time` Defines if logging date and time should be local or UTC Implement two new flags to enable or disable specific logging types `-standard-logging` Enables or disables standard (not request or auth) logging `-auth-logging` Enables or disables auth logging Implement two new flags to customize the logging format `-standard-logging-format` Sets the format for standard logging `-auth-logging-format` Sets the format for auth logging Add option for telling where to find a login.gov JWT key file (@timothy-spencer) Restore binary tarball contents to be compatible with bitlys original tarballs (@zeha) Fix an unsupported protocol scheme error during token validation when using the Azure provider (@jonas) Check google group membership based on email address (@bchess) Google Group membership is additionally checked via email address, allowing users outside a GSuite domain to be authorized. Add `-banner` flag for overriding the banner line that is displayed (@steakunderscore) Switch from gometalinter to golangci-lint (@steakunderscore) Add option to skip the OIDC provider verified email check: `--insecure-oidc-allow-unverified-email` (@djfinlay) Update base image from Alpine 3.9 to

(@steakunderscore) Add Bitbucket as new OAuth2 provider, accepts email, team and repository permissions to determine authorization (@aledeganopix4d) Implement flags to enable Bitbucket authentication: `-bitbucket-repository` Restrict authorization to users that can access this repository `-bitbucket-team` Restrict authorization to users that are part of this Bitbucket team Switch from dep to go modules (@steakunderscore) Add support for OIDC UserInfo endpoint email verification (@rtluckie) Internal restructure of session state storage to use JSON rather than proprietary scheme Added health check options for running on GCP behind a load balancer Improved support for protecting websockets Added provider for login.gov Allow manual configuration of OIDC providers Dockerfile user is now non-root, this may break your existing deployment In the OIDC provider, when no email is returned, the ID Token subject will be used instead of returning an error GitHub user emails must now be primary and verified before authenticating Check if email is verified on GitHub (@caarlos0) Added GCP healthcheck option (@timothy-spencer) Improve websocket support (@gyson) Use encoding/json for SessionState serialization (@yaegashi) Use JSON to encode session state to be stored in browser cookies Implement legacy decode function to support existing cookies generated by older versions Add detailed table driven tests in sessionstatetest.go Encrypting user/email from cookie (@costelmoraru) Added login.gov provider (@timothy-spencer) Added environment variables for all config options (@timothy-spencer) Fix handling of splitted cookies (@einfachchr) Merge websocket proxy feature from openshift/oauth-proxy (@butzist) Fall back to using OIDC Subject instead of Email (@aigarius) Use non-root user in docker images (@kskewes) forward X-Auth-Access-Token header (@davidholsgrove) Added option to manually specify OIDC endpoints instead of relying on discovery Add `id_token` refresh to Google provider (@leki75) fix redirect url param handling (@dt-rush) Expose -cookie-path as configuration parameter (@costelmoraru) Use Go 1.12 for testing and build environments (@syscll) Introduction of ARM releases and and general improvements to Docker builds Improvements to OIDC provider allowing pass-through of ID Tokens Multiple redirect domains can now be whitelisted Streamed responses are now flushed periodically If you have been using and have cookies larger than the 4kb limit, the cookie splitting pattern has changed and now uses `_` in place of `-` when indexing cookies. This will force users to reauthenticate the first time they use `v3.1.0`. Streamed responses will now be flushed every 1 second by default. Previously streamed responses were flushed only when the buffer was full. To retain the old behaviour set `--flush-interval=0`. See for further details. OIDC ID Token, Authorization Headers, Refreshing and Verification (@joelspeed) Implement `pass-authorization-header` and `set-authorization-header` flags Implement token refreshing in OIDC provider Split cookies larger than 4k limit into multiple cookies Implement token validation in OIDC provider WhitelistDomains (@joelspeed) Add `--whitelist-domain` flag to allow redirection to approved domains after OAuth flow Docker Improvement (@yaegashi) Move Docker base image from debian to alpine Install ca-certificates in docker image Flushed streaming responses Long-running upstream responses will get flushed every <timeperiod> (1 second by default) Redirect fix (@agentgonzo) After a successful login, you will be redirected to your original URL rather than / arm and arm64 binary releases (@kskewes) Add armv6 and arm64 to Makefile `release` target cross build arm and arm64 docker images (@kskewes) Adoption of OAuth2_Proxy by Pusher. Project was hard forked and tidied however no logical changes have occurred since v2.2 as released by Bitly. Migration to Pusher (@joelspeed) Move automated build to debian base image Add Makefile Update CI to run `make test` Update Dockerfile to use `make clean oauth2_proxy` Update `VERSION` parameter to be set by `ldflags` from Git Status Remove lint and test scripts Remove Go v1.8.x from Travis CI testing Add CODEOWNERS file Add CONTRIBUTING guide Add Issue and Pull Request