From 08e19e7d0bab48bd9acb8a63a678cdd39b48cf03 Mon Sep 17 00:00:00 2001 From: gh-actions Date: Tue, 18 Jan 2022 13:55:53 +0000 Subject: [PATCH] Deploy website - based on 92c4ca9c58877048f8423d6071a454df014449c9 --- 357fe94d.8c339c91.js => 357fe94d.d8a20ffe.js | 2 +- 404.html | 10 +++++----- docs/6.1.x/behaviour/index.html | 10 +++++----- docs/6.1.x/community/security/index.html | 10 +++++----- .../configuration/oauth_provider/index.html | 10 +++++----- docs/6.1.x/configuration/overview/index.html | 10 +++++----- .../configuration/session_storage/index.html | 10 +++++----- docs/6.1.x/configuration/tls/index.html | 10 +++++----- docs/6.1.x/features/endpoints/index.html | 10 +++++----- .../6.1.x/features/request_signatures/index.html | 10 +++++----- docs/6.1.x/index.html | 10 +++++----- docs/7.0.x/behaviour/index.html | 10 +++++----- docs/7.0.x/community/security/index.html | 10 +++++----- docs/7.0.x/configuration/alpha-config/index.html | 10 +++++----- .../configuration/oauth_provider/index.html | 10 +++++----- docs/7.0.x/configuration/overview/index.html | 10 +++++----- .../configuration/session_storage/index.html | 10 +++++----- docs/7.0.x/configuration/tls/index.html | 10 +++++----- docs/7.0.x/features/endpoints/index.html | 10 +++++----- .../7.0.x/features/request_signatures/index.html | 10 +++++----- docs/7.0.x/index.html | 10 +++++----- docs/7.1.x/behaviour/index.html | 10 +++++----- docs/7.1.x/community/security/index.html | 10 +++++----- docs/7.1.x/configuration/alpha-config/index.html | 10 +++++----- .../configuration/oauth_provider/index.html | 10 +++++----- docs/7.1.x/configuration/overview/index.html | 10 +++++----- .../configuration/session_storage/index.html | 10 +++++----- docs/7.1.x/configuration/tls/index.html | 10 +++++----- docs/7.1.x/features/endpoints/index.html | 10 +++++----- docs/7.1.x/index.html | 10 +++++----- docs/behaviour/index.html | 10 +++++----- docs/community/security/index.html | 10 +++++----- docs/configuration/alpha-config/index.html | 10 +++++----- docs/configuration/oauth_provider/index.html | 10 +++++----- docs/configuration/overview/index.html | 10 +++++----- docs/configuration/session_storage/index.html | 10 +++++----- docs/configuration/tls/index.html | 10 +++++----- docs/features/endpoints/index.html | 10 +++++----- docs/index.html | 10 +++++----- docs/next/behaviour/index.html | 10 +++++----- docs/next/community/security/index.html | 10 +++++----- docs/next/configuration/alpha-config/index.html | 10 +++++----- .../next/configuration/oauth_provider/index.html | 16 ++++++++-------- docs/next/configuration/overview/index.html | 10 +++++----- .../configuration/session_storage/index.html | 10 +++++----- docs/next/configuration/tls/index.html | 10 +++++----- docs/next/features/endpoints/index.html | 10 +++++----- docs/next/index.html | 10 +++++----- index.html | 10 +++++----- main.b7d0cfde.js => main.089aca77.js | 4 ++-- ...s.LICENSE.txt => main.089aca77.js.LICENSE.txt | 0 ...~main.36f31be2.js => runtime~main.34f995af.js | 2 +- 52 files changed, 247 insertions(+), 247 deletions(-) rename 357fe94d.8c339c91.js => 357fe94d.d8a20ffe.js (99%) rename main.b7d0cfde.js => main.089aca77.js (99%) rename main.b7d0cfde.js.LICENSE.txt => main.089aca77.js.LICENSE.txt (100%) rename runtime~main.36f31be2.js => runtime~main.34f995af.js (98%) diff --git a/357fe94d.8c339c91.js b/357fe94d.d8a20ffe.js similarity index 99% rename from 357fe94d.8c339c91.js rename to 357fe94d.d8a20ffe.js index e2b337e6..02d01fe8 100644 --- a/357fe94d.8c339c91.js +++ b/357fe94d.d8a20ffe.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{116:function(e,t,a){"use strict";a.d(t,"a",(function(){return s})),a.d(t,"b",(function(){return h}));var o=a(0),n=a.n(o);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function l(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var p=n.a.createContext({}),b=function(e){var t=n.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},s=function(e){var t=b(e.components);return n.a.createElement(p.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.a.createElement(n.a.Fragment,{},t)}},d=n.a.forwardRef((function(e,t){var a=e.components,o=e.mdxType,r=e.originalType,i=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),s=b(a),d=o,h=s["".concat(i,".").concat(d)]||s[d]||u[d]||r;return a?n.a.createElement(h,l(l({ref:t},p),{},{components:a})):n.a.createElement(h,l({ref:t},p))}));function h(e,t){var a=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=a.length,i=new Array(r);i[0]=d;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:o,i[1]=l;for(var p=2;p\n --client-secret=\n --oidc-issuer-url=https://sts.windows.net/{tenant-id}/\n")),Object(r.b)("p",null,"Note: When using the Azure Auth provider with nginx and the cookie session store you may find the cookie is too large and doesn't get passed through correctly. Increasing the proxy_buffer_size in nginx or implementing the ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"/oauth2-proxy/docs/next/configuration/session_storage#redis-storage"}),"redis session storage")," should resolve this."),Object(r.b)("h3",{id:"adfs-auth-provider"},"ADFS Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Open the ADFS administration console on your Windows Server and add a new Application Group"),Object(r.b)("li",{parentName:"ol"},"Provide a name for the integration, select Server Application from the Standalone applications section and click Next"),Object(r.b)("li",{parentName:"ol"},"Follow the wizard to get the client-id, client-secret and configure the application credentials"),Object(r.b)("li",{parentName:"ol"},"Configure the proxy with")),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{})," --provider=adfs\n --client-id=\n --client-secret=\n")),Object(r.b)("p",null,"Note: When using the ADFS Auth provider with nginx and the cookie session store you may find the cookie is too large and doesn't get passed through correctly. Increasing the proxy_buffer_size in nginx or implementing the ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"/oauth2-proxy/docs/next/configuration/session_storage#redis-storage"}),"redis session storage")," should resolve this."),Object(r.b)("h3",{id:"facebook-auth-provider"},"Facebook Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create a new FB App from ",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://developers.facebook.com/"}),"https://developers.facebook.com/")),Object(r.b)("li",{parentName:"ol"},"Under FB Login, set your Valid OAuth redirect URIs to ",Object(r.b)("inlineCode",{parentName:"li"},"https://internal.yourcompany.com/oauth2/callback"))),Object(r.b)("h3",{id:"github-auth-provider"},"GitHub Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create a new project: ",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://github.com/settings/developers"}),"https://github.com/settings/developers")),Object(r.b)("li",{parentName:"ol"},"Under ",Object(r.b)("inlineCode",{parentName:"li"},"Authorization callback URL")," enter the correct url ie ",Object(r.b)("inlineCode",{parentName:"li"},"https://internal.yourcompany.com/oauth2/callback"))),Object(r.b)("p",null,"The GitHub auth provider supports two additional ways to restrict authentication to either organization and optional team level access, or to collaborators of a repository. Restricting by these options is normally accompanied with ",Object(r.b)("inlineCode",{parentName:"p"},"--email-domain=*")),Object(r.b)("p",null,"NOTE: When ",Object(r.b)("inlineCode",{parentName:"p"},"--github-user")," is set, the specified users are allowed to login even if they do not belong to the specified org and team or collaborators."),Object(r.b)("p",null,"To restrict by organization only, include the following flag:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-github-org="": restrict logins to members of this organisation\n')),Object(r.b)("p",null,"To restrict within an organization to specific teams, include the following flag in addition to ",Object(r.b)("inlineCode",{parentName:"p"},"-github-org"),":"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-github-team="": restrict logins to members of any of these teams (slug), separated by a comma\n')),Object(r.b)("p",null,"If you would rather restrict access to collaborators of a repository, those users must either have push access to a public repository or any access to a private repository:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-github-repo="": restrict logins to collaborators of this repository formatted as orgname/repo\n')),Object(r.b)("p",null,"If you'd like to allow access to users with ",Object(r.b)("strong",{parentName:"p"},"read only")," access to a ",Object(r.b)("strong",{parentName:"p"},"public")," repository you will need to provide a ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/settings/tokens"}),"token")," for a user that has write access to the repository. The token must be created with at least the ",Object(r.b)("inlineCode",{parentName:"p"},"public_repo")," scope:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-github-token="": the token to use when verifying repository collaborators\n')),Object(r.b)("p",null,"To allow a user to login with their username even if they do not belong to the specified org and team or collaborators, separated by a comma"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-github-user="": allow logins by username, separated by a comma\n')),Object(r.b)("p",null,"If you are using GitHub enterprise, make sure you set the following to the appropriate url:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-login-url="http(s):///login/oauth/authorize"\n-redeem-url="http(s):///login/oauth/access_token"\n-validate-url="http(s):///api/v3"\n')),Object(r.b)("h3",{id:"keycloak-auth-provider"},"Keycloak Auth Provider"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(o.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(o.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(o.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(o.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"note")),Object(r.b)("div",Object(o.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"This is the legacy provider for Keycloak, use ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"#keycloak-oidc-auth-provider"}),"Keycloak OIDC Auth Provider")," if possible."))),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create new client in your Keycloak realm with ",Object(r.b)("strong",{parentName:"li"},"Access Type")," 'confidental' and ",Object(r.b)("strong",{parentName:"li"},"Valid Redirect URIs")," '",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://internal.yourcompany.com/oauth2/callback'"}),"https://internal.yourcompany.com/oauth2/callback'")),Object(r.b)("li",{parentName:"ol"},"Take note of the Secret in the credential tab of the client"),Object(r.b)("li",{parentName:"ol"},"Create a mapper with ",Object(r.b)("strong",{parentName:"li"},"Mapper Type")," 'Group Membership' and ",Object(r.b)("strong",{parentName:"li"},"Token Claim Name")," 'groups'.")),Object(r.b)("p",null,"Make sure you set the following to the appropriate url:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),' --provider=keycloak\n --client-id=\n --client-secret=\n --login-url="http(s):///auth/realms//protocol/openid-connect/auth"\n --redeem-url="http(s):///auth/realms//protocol/openid-connect/token"\n --profile-url="http(s):///auth/realms//protocol/openid-connect/userinfo"\n --validate-url="http(s):///auth/realms//protocol/openid-connect/userinfo"\n --keycloak-group=\n --keycloak-group=\n')),Object(r.b)("p",null,"For group based authorization, the optional ",Object(r.b)("inlineCode",{parentName:"p"},"--keycloak-group")," (legacy) or ",Object(r.b)("inlineCode",{parentName:"p"},"--allowed-group")," (global standard)\nflags can be used to specify which groups to limit access to."),Object(r.b)("p",null,"If these are unset but a ",Object(r.b)("inlineCode",{parentName:"p"},"groups")," mapper is set up above in step (3), the provider will still\npopulate the ",Object(r.b)("inlineCode",{parentName:"p"},"X-Forwarded-Groups")," header to your upstream server with the ",Object(r.b)("inlineCode",{parentName:"p"},"groups")," data in the\nKeycloak userinfo endpoint response."),Object(r.b)("p",null,"The group management in keycloak is using a tree. If you create a group named admin in keycloak\nyou should define the 'keycloak-group' value to /admin."),Object(r.b)("h3",{id:"keycloak-oidc-auth-provider"},"Keycloak OIDC Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create new client in your Keycloak realm with ",Object(r.b)("strong",{parentName:"li"},"Access Type")," 'confidental', ",Object(r.b)("strong",{parentName:"li"},"Client protocol")," 'openid-connect' and ",Object(r.b)("strong",{parentName:"li"},"Valid Redirect URIs")," '",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://internal.yourcompany.com/oauth2/callback'"}),"https://internal.yourcompany.com/oauth2/callback'")),Object(r.b)("li",{parentName:"ol"},"Take note of the Secret in the credential tab of the client"),Object(r.b)("li",{parentName:"ol"},"Create a mapper with ",Object(r.b)("strong",{parentName:"li"},"Mapper Type")," 'Group Membership' and ",Object(r.b)("strong",{parentName:"li"},"Token Claim Name")," 'groups'."),Object(r.b)("li",{parentName:"ol"},"Create a mapper with ",Object(r.b)("strong",{parentName:"li"},"Mapper Type")," 'Audience' and ",Object(r.b)("strong",{parentName:"li"},"Included Client Audience")," and ",Object(r.b)("strong",{parentName:"li"},"Included Custom Audience")," set to your client name.")),Object(r.b)("p",null,"Make sure you set the following to the appropriate url:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{})," --provider=keycloak-oidc\n --client-id=\n --client-secret=\n --redirect-url=https://myapp.com/oauth2/callback\n --oidc-issuer-url=https:///auth//basic\n --allowed-role= // Optional, required realm role\n --allowed-role=: // Optional, required client role\n")),Object(r.b)("h3",{id:"gitlab-auth-provider"},"GitLab Auth Provider"),Object(r.b)("p",null,"This auth provider has been tested against Gitlab version 12.X. Due to Gitlab API changes, it may not work for version prior to 12.X (see ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/oauth2-proxy/oauth2-proxy/issues/994"}),"994"),")."),Object(r.b)("p",null,"Whether you are using GitLab.com or self-hosting GitLab, follow ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://docs.gitlab.com/ce/integration/oauth_provider.html"}),"these steps to add an application"),". Make sure to enable at least the ",Object(r.b)("inlineCode",{parentName:"p"},"openid"),", ",Object(r.b)("inlineCode",{parentName:"p"},"profile")," and ",Object(r.b)("inlineCode",{parentName:"p"},"email")," scopes, and set the redirect url to your application url e.g. ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://myapp.com/oauth2/callback"}),"https://myapp.com/oauth2/callback"),"."),Object(r.b)("p",null,"If you need projects filtering, add the extra ",Object(r.b)("inlineCode",{parentName:"p"},"read_api")," scope to your application."),Object(r.b)("p",null,"The following config should be set to ensure that the oauth will work properly. To get a cookie secret follow ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"/oauth2-proxy/docs/next/configuration/overview#generating-a-cookie-secret"}),"these steps")),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),' --provider="gitlab"\n --redirect-url="https://myapp.com/oauth2/callback" // Should be the same as the redirect url for the application in gitlab\n --client-id=GITLAB_CLIENT_ID\n --client-secret=GITLAB_CLIENT_SECRET\n --cookie-secret=COOKIE_SECRET\n')),Object(r.b)("p",null,"Restricting by group membership is possible with the following option:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'--gitlab-group="mygroup,myothergroup": restrict logins to members of any of these groups (slug), separated by a comma\n')),Object(r.b)("p",null,"If you are using self-hosted GitLab, make sure you set the following to the appropriate URL:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'--oidc-issuer-url=""\n')),Object(r.b)("h3",{id:"linkedin-auth-provider"},"LinkedIn Auth Provider"),Object(r.b)("p",null,"For LinkedIn, the registration steps are:"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create a new project: ",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://www.linkedin.com/secure/developer"}),"https://www.linkedin.com/secure/developer")),Object(r.b)("li",{parentName:"ol"},"In the OAuth User Agreement section:",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},"In default scope, select r_basicprofile and r_emailaddress."),Object(r.b)("li",{parentName:"ul"},'In "OAuth 2.0 Redirect URLs", enter ',Object(r.b)("inlineCode",{parentName:"li"},"https://internal.yourcompany.com/oauth2/callback")))),Object(r.b)("li",{parentName:"ol"},"Fill in the remaining required fields and Save."),Object(r.b)("li",{parentName:"ol"},"Take note of the ",Object(r.b)("strong",{parentName:"li"},"Consumer Key / API Key")," and ",Object(r.b)("strong",{parentName:"li"},"Consumer Secret / Secret Key"))),Object(r.b)("h3",{id:"microsoft-azure-ad-provider"},"Microsoft Azure AD Provider"),Object(r.b)("p",null,"For adding an application to the Microsoft Azure AD follow ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app"}),"these steps to add an application"),"."),Object(r.b)("p",null,"Take note of your ",Object(r.b)("inlineCode",{parentName:"p"},"TenantId")," if applicable for your situation. The ",Object(r.b)("inlineCode",{parentName:"p"},"TenantId")," can be used to override the default ",Object(r.b)("inlineCode",{parentName:"p"},"common")," authorization server with a tenant specific server."),Object(r.b)("h3",{id:"openid-connect-provider"},"OpenID Connect Provider"),Object(r.b)("p",null,"OpenID Connect is a spec for OAUTH 2.0 + identity that is implemented by many major providers and several open source projects."),Object(r.b)("p",null,"This provider was originally built against CoreOS Dex and we will use it as an example.\nThe OpenID Connect Provider (OIDC) can also be used to connect to other Identity Providers such as Okta, an example can be found below."),Object(r.b)("h4",{id:"dex"},"Dex"),Object(r.b)("p",null,"To configure the OIDC provider for Dex, perform the following steps:"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"Download Dex:"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),"go get github.com/dexidp/dex\n")),Object(r.b)("p",{parentName:"li"},"See the ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/coreos/dex/blob/master/Documentation/getting-started.md"}),"getting started guide")," for more details.")),Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"Setup oauth2-proxy with the correct provider and using the default ports and callbacks. Add a configuration block to the ",Object(r.b)("inlineCode",{parentName:"p"},"staticClients")," section of ",Object(r.b)("inlineCode",{parentName:"p"},"examples/config-dev.yaml"),":"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),"- id: oauth2-proxy\nredirectURIs:\n- 'http://127.0.0.1:4180/oauth2/callback'\nname: 'oauth2-proxy'\nsecret: proxy\n"))),Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"Launch Dex: from ",Object(r.b)("inlineCode",{parentName:"p"},"$GOPATH/github.com/dexidp/dex"),", run:"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),"bin/dex serve examples/config-dev.yaml\n"))),Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"In a second terminal, run the oauth2-proxy with the following args:"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-provider oidc\n-provider-display-name "My OIDC Provider"\n-client-id oauth2-proxy\n-client-secret proxy\n-redirect-url http://127.0.0.1:4180/oauth2/callback\n-oidc-issuer-url http://127.0.0.1:5556/dex\n-cookie-secure=false\n-cookie-secret=secret\n-email-domain kilgore.trout\n')),Object(r.b)("p",{parentName:"li"},"To serve the current working directory as a web site under the ",Object(r.b)("inlineCode",{parentName:"p"},"/static")," endpoint, add:"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),"-upstream file://$PWD/#/static/\n"))),Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"Test the setup by visiting ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"http://127.0.0.1:4180"}),"http://127.0.0.1:4180")," or ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"http://127.0.0.1:4180/static"}),"http://127.0.0.1:4180/static")," ."))),Object(r.b)("p",null,"See also ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/oauth2-proxy/oauth2-proxy/blob/master/contrib/local-environment"}),"our local testing environment")," for a self-contained example using Docker and etcd as storage for Dex."),Object(r.b)("h4",{id:"okta"},"Okta"),Object(r.b)("p",null,"To configure the OIDC provider for Okta, perform the following steps:"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Log in to Okta using an administrative account. It is suggested you try this in preview first, ",Object(r.b)("inlineCode",{parentName:"li"},"example.oktapreview.com")),Object(r.b)("li",{parentName:"ol"},"(OPTIONAL) If you want to configure authorization scopes and claims to be passed on to multiple applications,\nyou may wish to configure an authorization server for each application. Otherwise, the provided ",Object(r.b)("inlineCode",{parentName:"li"},"default")," will work.")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Navigate to ",Object(r.b)("strong",{parentName:"li"},"Security")," then select ",Object(r.b)("strong",{parentName:"li"},"API")),Object(r.b)("li",{parentName:"ul"},"Click ",Object(r.b)("strong",{parentName:"li"},"Add Authorization Server"),", if this option is not available you may require an additional license for a custom authorization server."),Object(r.b)("li",{parentName:"ul"},"Fill out the ",Object(r.b)("strong",{parentName:"li"},"Name")," with something to describe the application you are protecting. e.g. 'Example App'."),Object(r.b)("li",{parentName:"ul"},"For ",Object(r.b)("strong",{parentName:"li"},"Audience"),", pick the URL of the application you wish to protect: ",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://example.corp.com"}),"https://example.corp.com")),Object(r.b)("li",{parentName:"ul"},"Fill out a ",Object(r.b)("strong",{parentName:"li"},"Description")),Object(r.b)("li",{parentName:"ul"},"Add any ",Object(r.b)("strong",{parentName:"li"},"Access Policies")," you wish to configure to limit application access."),Object(r.b)("li",{parentName:"ul"},"The default settings will work for other options.\n",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://developer.okta.com/docs/guides/customize-authz-server/overview/"}),"See Okta documentation for more information on Authorization Servers"))),Object(r.b)("ol",{start:3},Object(r.b)("li",{parentName:"ol"},"Navigate to ",Object(r.b)("strong",{parentName:"li"},"Applications")," then select ",Object(r.b)("strong",{parentName:"li"},"Add Application"),".")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Select ",Object(r.b)("strong",{parentName:"li"},"Web")," for the ",Object(r.b)("strong",{parentName:"li"},"Platform")," setting."),Object(r.b)("li",{parentName:"ul"},"Select ",Object(r.b)("strong",{parentName:"li"},"OpenID Connect")," and click ",Object(r.b)("strong",{parentName:"li"},"Create")),Object(r.b)("li",{parentName:"ul"},"Pick an ",Object(r.b)("strong",{parentName:"li"},"Application Name")," such as ",Object(r.b)("inlineCode",{parentName:"li"},"Example App"),"."),Object(r.b)("li",{parentName:"ul"},"Set the ",Object(r.b)("strong",{parentName:"li"},"Login redirect URI")," to ",Object(r.b)("inlineCode",{parentName:"li"},"https://example.corp.com"),"."),Object(r.b)("li",{parentName:"ul"},"Under ",Object(r.b)("strong",{parentName:"li"},"General")," set the ",Object(r.b)("strong",{parentName:"li"},"Allowed grant types")," to ",Object(r.b)("inlineCode",{parentName:"li"},"Authorization Code")," and ",Object(r.b)("inlineCode",{parentName:"li"},"Refresh Token"),"."),Object(r.b)("li",{parentName:"ul"},"Leave the rest as default, taking note of the ",Object(r.b)("inlineCode",{parentName:"li"},"Client ID")," and ",Object(r.b)("inlineCode",{parentName:"li"},"Client Secret"),"."),Object(r.b)("li",{parentName:"ul"},"Under ",Object(r.b)("strong",{parentName:"li"},"Assignments")," select the users or groups you wish to access your application.")),Object(r.b)("ol",{start:4},Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"Create a configuration file like the following:"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'provider = "oidc"\nredirect_url = "https://example.corp.com/oauth2/callback"\noidc_issuer_url = "https://corp.okta.com/oauth2/abCd1234"\nupstreams = [\n "https://example.corp.com"\n]\nemail_domains = [\n "corp.com"\n]\nclient_id = "XXXXX"\nclient_secret = "YYYYY"\npass_access_token = true\ncookie_secret = "ZZZZZ"\nskip_provider_button = true\n')))),Object(r.b)("p",null,"The ",Object(r.b)("inlineCode",{parentName:"p"},"oidc_issuer_url")," is based on URL from your ",Object(r.b)("strong",{parentName:"p"},"Authorization Server"),"'s ",Object(r.b)("strong",{parentName:"p"},"Issuer")," field in step 2, or simply ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://corp.okta.com"}),"https://corp.okta.com")," .\nThe ",Object(r.b)("inlineCode",{parentName:"p"},"client_id")," and ",Object(r.b)("inlineCode",{parentName:"p"},"client_secret")," are configured in the application settings.\nGenerate a unique ",Object(r.b)("inlineCode",{parentName:"p"},"client_secret")," to encrypt the cookie."),Object(r.b)("p",null,"Then you can start the oauth2-proxy with ",Object(r.b)("inlineCode",{parentName:"p"},"./oauth2-proxy --config /etc/example.cfg")),Object(r.b)("h4",{id:"okta---localhost"},"Okta - localhost"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Signup for developer account: ",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://developer.okta.com/signup/"}),"https://developer.okta.com/signup/")),Object(r.b)("li",{parentName:"ol"},"Create New ",Object(r.b)("inlineCode",{parentName:"li"},"Web")," Application: https://${your-okta-domain}/dev/console/apps/new"),Object(r.b)("li",{parentName:"ol"},"Example Application Settings for localhost:",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Name:")," My Web App"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Base URIs:")," http://localhost:4180/"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Login redirect URIs:")," http://localhost:4180/oauth2/callback"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Logout redirect URIs:")," http://localhost:4180/"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Group assignments:")," ",Object(r.b)("inlineCode",{parentName:"li"},"Everyone")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Grant type allowed:")," ",Object(r.b)("inlineCode",{parentName:"li"},"Authorization Code")," and ",Object(r.b)("inlineCode",{parentName:"li"},"Refresh Token")))),Object(r.b)("li",{parentName:"ol"},"Make note of the ",Object(r.b)("inlineCode",{parentName:"li"},"Client ID")," and ",Object(r.b)("inlineCode",{parentName:"li"},"Client secret"),", they are needed in a future step"),Object(r.b)("li",{parentName:"ol"},"Make note of the ",Object(r.b)("strong",{parentName:"li"},"default")," Authorization Server Issuer URI from: https://${your-okta-domain}/admin/oauth2/as"),Object(r.b)("li",{parentName:"ol"},"Example config file ",Object(r.b)("inlineCode",{parentName:"li"},"/etc/localhost.cfg"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'provider = "oidc"\nredirect_url = "http://localhost:4180/oauth2/callback"\noidc_issuer_url = "https://${your-okta-domain}/oauth2/default"\nupstreams = [\n "http://0.0.0.0:8080"\n]\nemail_domains = [\n "*"\n]\nclient_id = "XXX"\nclient_secret = "YYY"\npass_access_token = true\ncookie_secret = "ZZZ"\ncookie_secure = false\nskip_provider_button = true\n# Note: use the following for testing within a container\n# http_address = "0.0.0.0:4180"\n'))),Object(r.b)("li",{parentName:"ol"},"Then you can start the oauth2-proxy with ",Object(r.b)("inlineCode",{parentName:"li"},"./oauth2-proxy --config /etc/localhost.cfg"))),Object(r.b)("h3",{id:"logingov-provider"},"login.gov Provider"),Object(r.b)("p",null,"login.gov is an OIDC provider for the US Government.\nIf you are a US Government agency, you can contact the login.gov team through the contact information\nthat you can find on ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://login.gov/developers/"}),"https://login.gov/developers/")," and work with them to understand how to get login.gov\naccounts for integration/test and production access."),Object(r.b)("p",null,"A developer guide is available here: ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://developers.login.gov/"}),"https://developers.login.gov/"),", though this proxy handles everything\nbut the data you need to create to register your application in the login.gov dashboard."),Object(r.b)("p",null,"As a demo, we will assume that you are running your application that you want to secure locally on\nhttp://localhost:3000/, that you will be starting your proxy up on http://localhost:4180/, and that\nyou have an agency integration account for testing."),Object(r.b)("p",null,"First, register your application in the dashboard. The important bits are:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Identity protocol: make this ",Object(r.b)("inlineCode",{parentName:"li"},"Openid connect")),Object(r.b)("li",{parentName:"ul"},"Issuer: do what they say for OpenID Connect. We will refer to this string as ",Object(r.b)("inlineCode",{parentName:"li"},"${LOGINGOV_ISSUER}"),"."),Object(r.b)("li",{parentName:"ul"},"Public key: This is a self-signed certificate in .pem format generated from a 2048 bit RSA private key.\nA quick way to do this is ",Object(r.b)("inlineCode",{parentName:"li"},"openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3650 -nodes -subj '/C=US/ST=Washington/L=DC/O=GSA/OU=18F/CN=localhost'"),",\nThe contents of the ",Object(r.b)("inlineCode",{parentName:"li"},"key.pem")," shall be referred to as ",Object(r.b)("inlineCode",{parentName:"li"},"${OAUTH2_PROXY_JWT_KEY}"),"."),Object(r.b)("li",{parentName:"ul"},"Return to App URL: Make this be ",Object(r.b)("inlineCode",{parentName:"li"},"http://localhost:4180/")),Object(r.b)("li",{parentName:"ul"},"Redirect URIs: Make this be ",Object(r.b)("inlineCode",{parentName:"li"},"http://localhost:4180/oauth2/callback"),"."),Object(r.b)("li",{parentName:"ul"},"Attribute Bundle: Make sure that email is selected.")),Object(r.b)("p",null,"Now start the proxy up with the following options:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'./oauth2-proxy -provider login.gov \\\n -client-id=${LOGINGOV_ISSUER} \\\n -redirect-url=http://localhost:4180/oauth2/callback \\\n -oidc-issuer-url=https://idp.int.identitysandbox.gov/ \\\n -cookie-secure=false \\\n -email-domain=gsa.gov \\\n -upstream=http://localhost:3000/ \\\n -cookie-secret=somerandomstring12341234567890AB \\\n -cookie-domain=localhost \\\n -skip-provider-button=true \\\n -pubjwk-url=https://idp.int.identitysandbox.gov/api/openid_connect/certs \\\n -profile-url=https://idp.int.identitysandbox.gov/api/openid_connect/userinfo \\\n -jwt-key="${OAUTH2_PROXY_JWT_KEY}"\n')),Object(r.b)("p",null,"You can also set all these options with environment variables, for use in cloud/docker environments.\nOne tricky thing that you may encounter is that some cloud environments will pass in environment\nvariables in a docker env-file, which does not allow multiline variables like a PEM file.\nIf you encounter this, then you can create a ",Object(r.b)("inlineCode",{parentName:"p"},"jwt_signing_key.pem")," file in the top level\ndirectory of the repo which contains the key in PEM format and then do your docker build.\nThe docker build process will copy that file into your image which you can then access by\nsetting the ",Object(r.b)("inlineCode",{parentName:"p"},"OAUTH2_PROXY_JWT_KEY_FILE=/etc/ssl/private/jwt_signing_key.pem"),"\nenvironment variable, or by setting ",Object(r.b)("inlineCode",{parentName:"p"},"--jwt-key-file=/etc/ssl/private/jwt_signing_key.pem")," on the commandline."),Object(r.b)("p",null,"Once it is running, you should be able to go to ",Object(r.b)("inlineCode",{parentName:"p"},"http://localhost:4180/")," in your browser,\nget authenticated by the login.gov integration server, and then get proxied on to your\napplication running on ",Object(r.b)("inlineCode",{parentName:"p"},"http://localhost:3000/"),". In a real deployment, you would secure\nyour application with a firewall or something so that it was only accessible from the\nproxy, and you would use real hostnames everywhere."),Object(r.b)("h4",{id:"skip-oidc-discovery"},"Skip OIDC discovery"),Object(r.b)("p",null,"Some providers do not support OIDC discovery via their issuer URL, so oauth2-proxy cannot simply grab the authorization, token and jwks URI endpoints from the provider's metadata."),Object(r.b)("p",null,"In this case, you can set the ",Object(r.b)("inlineCode",{parentName:"p"},"--skip-oidc-discovery")," option, and supply those required endpoints manually:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{})," -provider oidc\n -client-id oauth2-proxy\n -client-secret proxy\n -redirect-url http://127.0.0.1:4180/oauth2/callback\n -oidc-issuer-url http://127.0.0.1:5556\n -skip-oidc-discovery\n -login-url http://127.0.0.1:5556/authorize\n -redeem-url http://127.0.0.1:5556/token\n -oidc-jwks-url http://127.0.0.1:5556/keys\n -cookie-secure=false\n -email-domain example.com\n")),Object(r.b)("h3",{id:"nextcloud-provider"},"Nextcloud Provider"),Object(r.b)("p",null,"The Nextcloud provider allows you to authenticate against users in your\nNextcloud instance."),Object(r.b)("p",null,"When you are using the Nextcloud provider, you must specify the urls via\nconfiguration, environment variable, or command line argument. Depending\non whether your Nextcloud instance is using pretty urls your urls may be of the\nform ",Object(r.b)("inlineCode",{parentName:"p"},"/index.php/apps/oauth2/*")," or ",Object(r.b)("inlineCode",{parentName:"p"},"/apps/oauth2/*"),"."),Object(r.b)("p",null,"Refer to the ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/oauth2.html"}),"OAuth2\ndocumentation"),'\nto setup the client id and client secret. Your "Redirection URI" will be\n',Object(r.b)("inlineCode",{parentName:"p"},"https://internalapp.yourcompany.com/oauth2/callback"),"."),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),' -provider nextcloud\n -client-id \n -client-secret \n -login-url="/index.php/apps/oauth2/authorize"\n -redeem-url="/index.php/apps/oauth2/api/v1/token"\n -validate-url="/ocs/v2.php/cloud/user?format=json"\n')),Object(r.b)("p",null,"Note: in ",Object(r.b)("em",{parentName:"p"},"all")," cases the validate-url will ",Object(r.b)("em",{parentName:"p"},"not")," have the ",Object(r.b)("inlineCode",{parentName:"p"},"index.php"),"."),Object(r.b)("h3",{id:"digitalocean-auth-provider"},"DigitalOcean Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://cloud.digitalocean.com/account/api/applications"}),"Create a new OAuth application"),Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},"You can fill in the name, homepage, and description however you wish."),Object(r.b)("li",{parentName:"ul"},'In the "Application callback URL" field, enter: ',Object(r.b)("inlineCode",{parentName:"li"},"https://oauth-proxy/oauth2/callback"),", substituting ",Object(r.b)("inlineCode",{parentName:"li"},"oauth2-proxy")," with the actual hostname that oauth2-proxy is running on. The URL must match oauth2-proxy's configured redirect URL."))),Object(r.b)("li",{parentName:"ol"},"Note the Client ID and Client Secret.")),Object(r.b)("p",null,"To use the provider, pass the following options:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{})," --provider=digitalocean\n --client-id=\n --client-secret=\n")),Object(r.b)("p",null," Alternatively, set the equivalent options in the config file. The redirect URL defaults to ",Object(r.b)("inlineCode",{parentName:"p"},"https:///oauth2/callback"),". If you need to change it, you can use the ",Object(r.b)("inlineCode",{parentName:"p"},"--redirect-url")," command-line option."),Object(r.b)("h3",{id:"bitbucket-auth-provider"},"Bitbucket Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html"}),"Add a new OAuth consumer"),Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},'In "Callback URL" use ',Object(r.b)("inlineCode",{parentName:"li"},"https:///oauth2/callback"),", substituting ",Object(r.b)("inlineCode",{parentName:"li"},"")," with the actual hostname that oauth2-proxy is running on."),Object(r.b)("li",{parentName:"ul"},"In Permissions section select:",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},"Account -> Email"),Object(r.b)("li",{parentName:"ul"},"Team membership -> Read"),Object(r.b)("li",{parentName:"ul"},"Repositories -> Read"))))),Object(r.b)("li",{parentName:"ol"},"Note the Client ID and Client Secret.")),Object(r.b)("p",null,"To use the provider, pass the following options:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{})," --provider=bitbucket\n --client-id=\n --client-secret=\n")),Object(r.b)("p",null,"The default configuration allows everyone with Bitbucket account to authenticate. To restrict the access to the team members use additional configuration option: ",Object(r.b)("inlineCode",{parentName:"p"},"--bitbucket-team="),". To restrict the access to only these users who has access to one selected repository use ",Object(r.b)("inlineCode",{parentName:"p"},"--bitbucket-repository="),"."),Object(r.b)("h3",{id:"gitea-auth-provider"},"Gitea Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create a new application: ",Object(r.b)("inlineCode",{parentName:"li"},"https://< your gitea host >/user/settings/applications")),Object(r.b)("li",{parentName:"ol"},"Under ",Object(r.b)("inlineCode",{parentName:"li"},"Redirect URI")," enter the correct URL i.e. ",Object(r.b)("inlineCode",{parentName:"li"},"https:///oauth2/callback")),Object(r.b)("li",{parentName:"ol"},"Note the Client ID and Client Secret."),Object(r.b)("li",{parentName:"ol"},"Pass the following options to the proxy:")),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),' --provider="github"\n --redirect-url="https:///oauth2/callback"\n --provider-display-name="Gitea"\n --client-id="< client_id as generated by Gitea >"\n --client-secret="< client_secret as generated by Gitea >"\n --login-url="https://< your gitea host >/login/oauth/authorize"\n --redeem-url="https://< your gitea host >/login/oauth/access_token"\n --validate-url="https://< your gitea host >/api/v1"\n')),Object(r.b)("h2",{id:"email-authentication"},"Email Authentication"),Object(r.b)("p",null,"To authorize by email domain use ",Object(r.b)("inlineCode",{parentName:"p"},"--email-domain=yourcompany.com"),". To authorize individual email addresses use ",Object(r.b)("inlineCode",{parentName:"p"},"--authenticated-emails-file=/path/to/file")," with one email per line. To authorize all email addresses use ",Object(r.b)("inlineCode",{parentName:"p"},"--email-domain=*"),"."),Object(r.b)("h2",{id:"adding-a-new-provider"},"Adding a new Provider"),Object(r.b)("p",null,"Follow the examples in the ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/oauth2-proxy/oauth2-proxy/blob/master/providers/"}),Object(r.b)("inlineCode",{parentName:"a"},"providers")," package")," to define a new\n",Object(r.b)("inlineCode",{parentName:"p"},"Provider")," instance. Add a new ",Object(r.b)("inlineCode",{parentName:"p"},"case")," to\n",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/oauth2-proxy/oauth2-proxy/blob/master/providers/providers.go"}),Object(r.b)("inlineCode",{parentName:"a"},"providers.New()"))," to allow ",Object(r.b)("inlineCode",{parentName:"p"},"oauth2-proxy")," to use the\nnew ",Object(r.b)("inlineCode",{parentName:"p"},"Provider"),"."))}b.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{116:function(e,t,a){"use strict";a.d(t,"a",(function(){return s})),a.d(t,"b",(function(){return h}));var o=a(0),n=a.n(o);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function l(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var p=n.a.createContext({}),b=function(e){var t=n.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},s=function(e){var t=b(e.components);return n.a.createElement(p.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.a.createElement(n.a.Fragment,{},t)}},d=n.a.forwardRef((function(e,t){var a=e.components,o=e.mdxType,r=e.originalType,i=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),s=b(a),d=o,h=s["".concat(i,".").concat(d)]||s[d]||u[d]||r;return a?n.a.createElement(h,l(l({ref:t},p),{},{components:a})):n.a.createElement(h,l({ref:t},p))}));function h(e,t){var a=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=a.length,i=new Array(r);i[0]=d;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:o,i[1]=l;for(var p=2;p\n --client-secret=\n --oidc-issuer-url=https://sts.windows.net/{tenant-id}/\n")),Object(r.b)("p",null,"Note: When using the Azure Auth provider with nginx and the cookie session store you may find the cookie is too large and doesn't get passed through correctly. Increasing the proxy_buffer_size in nginx or implementing the ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"/oauth2-proxy/docs/next/configuration/session_storage#redis-storage"}),"redis session storage")," should resolve this."),Object(r.b)("h3",{id:"adfs-auth-provider"},"ADFS Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Open the ADFS administration console on your Windows Server and add a new Application Group"),Object(r.b)("li",{parentName:"ol"},"Provide a name for the integration, select Server Application from the Standalone applications section and click Next"),Object(r.b)("li",{parentName:"ol"},"Follow the wizard to get the client-id, client-secret and configure the application credentials"),Object(r.b)("li",{parentName:"ol"},"Configure the proxy with")),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{})," --provider=adfs\n --client-id=\n --client-secret=\n")),Object(r.b)("p",null,"Note: When using the ADFS Auth provider with nginx and the cookie session store you may find the cookie is too large and doesn't get passed through correctly. Increasing the proxy_buffer_size in nginx or implementing the ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"/oauth2-proxy/docs/next/configuration/session_storage#redis-storage"}),"redis session storage")," should resolve this."),Object(r.b)("h3",{id:"facebook-auth-provider"},"Facebook Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create a new FB App from ",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://developers.facebook.com/"}),"https://developers.facebook.com/")),Object(r.b)("li",{parentName:"ol"},"Under FB Login, set your Valid OAuth redirect URIs to ",Object(r.b)("inlineCode",{parentName:"li"},"https://internal.yourcompany.com/oauth2/callback"))),Object(r.b)("h3",{id:"github-auth-provider"},"GitHub Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create a new project: ",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://github.com/settings/developers"}),"https://github.com/settings/developers")),Object(r.b)("li",{parentName:"ol"},"Under ",Object(r.b)("inlineCode",{parentName:"li"},"Authorization callback URL")," enter the correct url ie ",Object(r.b)("inlineCode",{parentName:"li"},"https://internal.yourcompany.com/oauth2/callback"))),Object(r.b)("p",null,"The GitHub auth provider supports two additional ways to restrict authentication to either organization and optional team level access, or to collaborators of a repository. Restricting by these options is normally accompanied with ",Object(r.b)("inlineCode",{parentName:"p"},"--email-domain=*")),Object(r.b)("p",null,"NOTE: When ",Object(r.b)("inlineCode",{parentName:"p"},"--github-user")," is set, the specified users are allowed to login even if they do not belong to the specified org and team or collaborators."),Object(r.b)("p",null,"To restrict by organization only, include the following flag:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-github-org="": restrict logins to members of this organisation\n')),Object(r.b)("p",null,"To restrict within an organization to specific teams, include the following flag in addition to ",Object(r.b)("inlineCode",{parentName:"p"},"-github-org"),":"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-github-team="": restrict logins to members of any of these teams (slug), separated by a comma\n')),Object(r.b)("p",null,"If you would rather restrict access to collaborators of a repository, those users must either have push access to a public repository or any access to a private repository:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-github-repo="": restrict logins to collaborators of this repository formatted as orgname/repo\n')),Object(r.b)("p",null,"If you'd like to allow access to users with ",Object(r.b)("strong",{parentName:"p"},"read only")," access to a ",Object(r.b)("strong",{parentName:"p"},"public")," repository you will need to provide a ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/settings/tokens"}),"token")," for a user that has write access to the repository. The token must be created with at least the ",Object(r.b)("inlineCode",{parentName:"p"},"public_repo")," scope:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-github-token="": the token to use when verifying repository collaborators\n')),Object(r.b)("p",null,"To allow a user to login with their username even if they do not belong to the specified org and team or collaborators, separated by a comma"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-github-user="": allow logins by username, separated by a comma\n')),Object(r.b)("p",null,"If you are using GitHub enterprise, make sure you set the following to the appropriate url:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-login-url="http(s):///login/oauth/authorize"\n-redeem-url="http(s):///login/oauth/access_token"\n-validate-url="http(s):///api/v3"\n')),Object(r.b)("h3",{id:"keycloak-auth-provider"},"Keycloak Auth Provider"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(o.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(o.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(o.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(o.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"note")),Object(r.b)("div",Object(o.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"This is the legacy provider for Keycloak, use ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"#keycloak-oidc-auth-provider"}),"Keycloak OIDC Auth Provider")," if possible."))),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create new client in your Keycloak realm with ",Object(r.b)("strong",{parentName:"li"},"Access Type")," 'confidental' and ",Object(r.b)("strong",{parentName:"li"},"Valid Redirect URIs")," '",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://internal.yourcompany.com/oauth2/callback'"}),"https://internal.yourcompany.com/oauth2/callback'")),Object(r.b)("li",{parentName:"ol"},"Take note of the Secret in the credential tab of the client"),Object(r.b)("li",{parentName:"ol"},"Create a mapper with ",Object(r.b)("strong",{parentName:"li"},"Mapper Type")," 'Group Membership' and ",Object(r.b)("strong",{parentName:"li"},"Token Claim Name")," 'groups'.")),Object(r.b)("p",null,"Make sure you set the following to the appropriate url:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),' --provider=keycloak\n --client-id=\n --client-secret=\n --login-url="http(s):///auth/realms//protocol/openid-connect/auth"\n --redeem-url="http(s):///auth/realms//protocol/openid-connect/token"\n --profile-url="http(s):///auth/realms//protocol/openid-connect/userinfo"\n --validate-url="http(s):///auth/realms//protocol/openid-connect/userinfo"\n --keycloak-group=\n --keycloak-group=\n')),Object(r.b)("p",null,"For group based authorization, the optional ",Object(r.b)("inlineCode",{parentName:"p"},"--keycloak-group")," (legacy) or ",Object(r.b)("inlineCode",{parentName:"p"},"--allowed-group")," (global standard)\nflags can be used to specify which groups to limit access to."),Object(r.b)("p",null,"If these are unset but a ",Object(r.b)("inlineCode",{parentName:"p"},"groups")," mapper is set up above in step (3), the provider will still\npopulate the ",Object(r.b)("inlineCode",{parentName:"p"},"X-Forwarded-Groups")," header to your upstream server with the ",Object(r.b)("inlineCode",{parentName:"p"},"groups")," data in the\nKeycloak userinfo endpoint response."),Object(r.b)("p",null,"The group management in keycloak is using a tree. If you create a group named admin in keycloak\nyou should define the 'keycloak-group' value to /admin."),Object(r.b)("h3",{id:"keycloak-oidc-auth-provider"},"Keycloak OIDC Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create new client in your Keycloak realm with ",Object(r.b)("strong",{parentName:"li"},"Access Type")," 'confidental', ",Object(r.b)("strong",{parentName:"li"},"Client protocol")," 'openid-connect' and ",Object(r.b)("strong",{parentName:"li"},"Valid Redirect URIs")," '",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://internal.yourcompany.com/oauth2/callback'"}),"https://internal.yourcompany.com/oauth2/callback'")),Object(r.b)("li",{parentName:"ol"},"Take note of the Secret in the credential tab of the client"),Object(r.b)("li",{parentName:"ol"},"Create a mapper with ",Object(r.b)("strong",{parentName:"li"},"Mapper Type")," 'Group Membership' and ",Object(r.b)("strong",{parentName:"li"},"Token Claim Name")," 'groups'."),Object(r.b)("li",{parentName:"ol"},"Create a mapper with ",Object(r.b)("strong",{parentName:"li"},"Mapper Type")," 'Audience' and ",Object(r.b)("strong",{parentName:"li"},"Included Client Audience")," and ",Object(r.b)("strong",{parentName:"li"},"Included Custom Audience")," set to your client name.")),Object(r.b)("p",null,"Make sure you set the following to the appropriate url:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{})," --provider=keycloak-oidc\n --client-id=\n --client-secret=\n --redirect-url=https://myapp.com/oauth2/callback\n --oidc-issuer-url=https:///auth//basic\n --allowed-role= // Optional, required realm role\n --allowed-role=: // Optional, required client role\n")),Object(r.b)("h3",{id:"gitlab-auth-provider"},"GitLab Auth Provider"),Object(r.b)("p",null,"This auth provider has been tested against Gitlab version 12.X. Due to Gitlab API changes, it may not work for version prior to 12.X (see ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/oauth2-proxy/oauth2-proxy/issues/994"}),"994"),")."),Object(r.b)("p",null,"Whether you are using GitLab.com or self-hosting GitLab, follow ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://docs.gitlab.com/ce/integration/oauth_provider.html"}),"these steps to add an application"),". Make sure to enable at least the ",Object(r.b)("inlineCode",{parentName:"p"},"openid"),", ",Object(r.b)("inlineCode",{parentName:"p"},"profile")," and ",Object(r.b)("inlineCode",{parentName:"p"},"email")," scopes, and set the redirect url to your application url e.g. ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://myapp.com/oauth2/callback"}),"https://myapp.com/oauth2/callback"),"."),Object(r.b)("p",null,"If you need projects filtering, add the extra ",Object(r.b)("inlineCode",{parentName:"p"},"read_api")," scope to your application."),Object(r.b)("p",null,"The following config should be set to ensure that the oauth will work properly. To get a cookie secret follow ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"/oauth2-proxy/docs/next/configuration/overview#generating-a-cookie-secret"}),"these steps")),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),' --provider="gitlab"\n --redirect-url="https://myapp.com/oauth2/callback" // Should be the same as the redirect url for the application in gitlab\n --client-id=GITLAB_CLIENT_ID\n --client-secret=GITLAB_CLIENT_SECRET\n --cookie-secret=COOKIE_SECRET\n')),Object(r.b)("p",null,"Restricting by group membership is possible with the following option:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'--gitlab-group="mygroup,myothergroup": restrict logins to members of any of these groups (slug), separated by a comma\n')),Object(r.b)("p",null,"If you are using self-hosted GitLab, make sure you set the following to the appropriate URL:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'--oidc-issuer-url=""\n')),Object(r.b)("h3",{id:"linkedin-auth-provider"},"LinkedIn Auth Provider"),Object(r.b)("p",null,"For LinkedIn, the registration steps are:"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create a new project: ",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://www.linkedin.com/secure/developer"}),"https://www.linkedin.com/secure/developer")),Object(r.b)("li",{parentName:"ol"},"In the OAuth User Agreement section:",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},"In default scope, select r_basicprofile and r_emailaddress."),Object(r.b)("li",{parentName:"ul"},'In "OAuth 2.0 Redirect URLs", enter ',Object(r.b)("inlineCode",{parentName:"li"},"https://internal.yourcompany.com/oauth2/callback")))),Object(r.b)("li",{parentName:"ol"},"Fill in the remaining required fields and Save."),Object(r.b)("li",{parentName:"ol"},"Take note of the ",Object(r.b)("strong",{parentName:"li"},"Consumer Key / API Key")," and ",Object(r.b)("strong",{parentName:"li"},"Consumer Secret / Secret Key"))),Object(r.b)("h3",{id:"microsoft-azure-ad-provider"},"Microsoft Azure AD Provider"),Object(r.b)("p",null,"For adding an application to the Microsoft Azure AD follow ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app"}),"these steps to add an application"),"."),Object(r.b)("p",null,"Take note of your ",Object(r.b)("inlineCode",{parentName:"p"},"TenantId")," if applicable for your situation. The ",Object(r.b)("inlineCode",{parentName:"p"},"TenantId")," can be used to override the default ",Object(r.b)("inlineCode",{parentName:"p"},"common")," authorization server with a tenant specific server."),Object(r.b)("h3",{id:"openid-connect-provider"},"OpenID Connect Provider"),Object(r.b)("p",null,"OpenID Connect is a spec for OAUTH 2.0 + identity that is implemented by many major providers and several open source projects."),Object(r.b)("p",null,"This provider was originally built against CoreOS Dex and we will use it as an example.\nThe OpenID Connect Provider (OIDC) can also be used to connect to other Identity Providers such as Okta, an example can be found below."),Object(r.b)("h4",{id:"dex"},"Dex"),Object(r.b)("p",null,"To configure the OIDC provider for Dex, perform the following steps:"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"Download Dex:"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),"go get github.com/dexidp/dex\n")),Object(r.b)("p",{parentName:"li"},"See the ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/coreos/dex/blob/master/Documentation/getting-started.md"}),"getting started guide")," for more details.")),Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"Setup oauth2-proxy with the correct provider and using the default ports and callbacks. Add a configuration block to the ",Object(r.b)("inlineCode",{parentName:"p"},"staticClients")," section of ",Object(r.b)("inlineCode",{parentName:"p"},"examples/config-dev.yaml"),":"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),"- id: oauth2-proxy\nredirectURIs:\n- 'http://127.0.0.1:4180/oauth2/callback'\nname: 'oauth2-proxy'\nsecret: proxy\n"))),Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"Launch Dex: from ",Object(r.b)("inlineCode",{parentName:"p"},"$GOPATH/github.com/dexidp/dex"),", run:"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),"bin/dex serve examples/config-dev.yaml\n"))),Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"In a second terminal, run the oauth2-proxy with the following args:"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'-provider oidc\n-provider-display-name "My OIDC Provider"\n-client-id oauth2-proxy\n-client-secret proxy\n-redirect-url http://127.0.0.1:4180/oauth2/callback\n-oidc-issuer-url http://127.0.0.1:5556/dex\n-cookie-secure=false\n-cookie-secret=secret\n-email-domain kilgore.trout\n')),Object(r.b)("p",{parentName:"li"},"To serve the current working directory as a web site under the ",Object(r.b)("inlineCode",{parentName:"p"},"/static")," endpoint, add:"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),"-upstream file://$PWD/#/static/\n"))),Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"Test the setup by visiting ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"http://127.0.0.1:4180"}),"http://127.0.0.1:4180")," or ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"http://127.0.0.1:4180/static"}),"http://127.0.0.1:4180/static")," ."))),Object(r.b)("p",null,"See also ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/oauth2-proxy/oauth2-proxy/blob/master/contrib/local-environment"}),"our local testing environment")," for a self-contained example using Docker and etcd as storage for Dex."),Object(r.b)("h4",{id:"okta"},"Okta"),Object(r.b)("p",null,"To configure the OIDC provider for Okta, perform the following steps:"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Log in to Okta using an administrative account. It is suggested you try this in preview first, ",Object(r.b)("inlineCode",{parentName:"li"},"example.oktapreview.com")),Object(r.b)("li",{parentName:"ol"},"(OPTIONAL) If you want to configure authorization scopes and claims to be passed on to multiple applications,\nyou may wish to configure an authorization server for each application. Otherwise, the provided ",Object(r.b)("inlineCode",{parentName:"li"},"default")," will work.")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Navigate to ",Object(r.b)("strong",{parentName:"li"},"Security")," then select ",Object(r.b)("strong",{parentName:"li"},"API")),Object(r.b)("li",{parentName:"ul"},"Click ",Object(r.b)("strong",{parentName:"li"},"Add Authorization Server"),", if this option is not available you may require an additional license for a custom authorization server."),Object(r.b)("li",{parentName:"ul"},"Fill out the ",Object(r.b)("strong",{parentName:"li"},"Name")," with something to describe the application you are protecting. e.g. 'Example App'."),Object(r.b)("li",{parentName:"ul"},"For ",Object(r.b)("strong",{parentName:"li"},"Audience"),", pick the URL of the application you wish to protect: ",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://example.corp.com"}),"https://example.corp.com")),Object(r.b)("li",{parentName:"ul"},"Fill out a ",Object(r.b)("strong",{parentName:"li"},"Description")),Object(r.b)("li",{parentName:"ul"},"Add any ",Object(r.b)("strong",{parentName:"li"},"Access Policies")," you wish to configure to limit application access."),Object(r.b)("li",{parentName:"ul"},"The default settings will work for other options.\n",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://developer.okta.com/docs/guides/customize-authz-server/overview/"}),"See Okta documentation for more information on Authorization Servers"))),Object(r.b)("ol",{start:3},Object(r.b)("li",{parentName:"ol"},"Navigate to ",Object(r.b)("strong",{parentName:"li"},"Applications")," then select ",Object(r.b)("strong",{parentName:"li"},"Add Application"),".")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Select ",Object(r.b)("strong",{parentName:"li"},"Web")," for the ",Object(r.b)("strong",{parentName:"li"},"Platform")," setting."),Object(r.b)("li",{parentName:"ul"},"Select ",Object(r.b)("strong",{parentName:"li"},"OpenID Connect")," and click ",Object(r.b)("strong",{parentName:"li"},"Create")),Object(r.b)("li",{parentName:"ul"},"Pick an ",Object(r.b)("strong",{parentName:"li"},"Application Name")," such as ",Object(r.b)("inlineCode",{parentName:"li"},"Example App"),"."),Object(r.b)("li",{parentName:"ul"},"Set the ",Object(r.b)("strong",{parentName:"li"},"Login redirect URI")," to ",Object(r.b)("inlineCode",{parentName:"li"},"https://example.corp.com"),"."),Object(r.b)("li",{parentName:"ul"},"Under ",Object(r.b)("strong",{parentName:"li"},"General")," set the ",Object(r.b)("strong",{parentName:"li"},"Allowed grant types")," to ",Object(r.b)("inlineCode",{parentName:"li"},"Authorization Code")," and ",Object(r.b)("inlineCode",{parentName:"li"},"Refresh Token"),"."),Object(r.b)("li",{parentName:"ul"},"Leave the rest as default, taking note of the ",Object(r.b)("inlineCode",{parentName:"li"},"Client ID")," and ",Object(r.b)("inlineCode",{parentName:"li"},"Client Secret"),"."),Object(r.b)("li",{parentName:"ul"},"Under ",Object(r.b)("strong",{parentName:"li"},"Assignments")," select the users or groups you wish to access your application.")),Object(r.b)("ol",{start:4},Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},"Create a configuration file like the following:"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'provider = "oidc"\nredirect_url = "https://example.corp.com/oauth2/callback"\noidc_issuer_url = "https://corp.okta.com/oauth2/abCd1234"\nupstreams = [\n "https://example.corp.com"\n]\nemail_domains = [\n "corp.com"\n]\nclient_id = "XXXXX"\nclient_secret = "YYYYY"\npass_access_token = true\ncookie_secret = "ZZZZZ"\nskip_provider_button = true\n')))),Object(r.b)("p",null,"The ",Object(r.b)("inlineCode",{parentName:"p"},"oidc_issuer_url")," is based on URL from your ",Object(r.b)("strong",{parentName:"p"},"Authorization Server"),"'s ",Object(r.b)("strong",{parentName:"p"},"Issuer")," field in step 2, or simply ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://corp.okta.com"}),"https://corp.okta.com")," .\nThe ",Object(r.b)("inlineCode",{parentName:"p"},"client_id")," and ",Object(r.b)("inlineCode",{parentName:"p"},"client_secret")," are configured in the application settings.\nGenerate a unique ",Object(r.b)("inlineCode",{parentName:"p"},"cookie_secret")," to encrypt the cookie."),Object(r.b)("p",null,"Then you can start the oauth2-proxy with ",Object(r.b)("inlineCode",{parentName:"p"},"./oauth2-proxy --config /etc/example.cfg")),Object(r.b)("h4",{id:"okta---localhost"},"Okta - localhost"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Signup for developer account: ",Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://developer.okta.com/signup/"}),"https://developer.okta.com/signup/")),Object(r.b)("li",{parentName:"ol"},"Create New ",Object(r.b)("inlineCode",{parentName:"li"},"Web")," Application: https://${your-okta-domain}/dev/console/apps/new"),Object(r.b)("li",{parentName:"ol"},"Example Application Settings for localhost:",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Name:")," My Web App"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Base URIs:")," http://localhost:4180/"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Login redirect URIs:")," http://localhost:4180/oauth2/callback"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Logout redirect URIs:")," http://localhost:4180/"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Group assignments:")," ",Object(r.b)("inlineCode",{parentName:"li"},"Everyone")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("strong",{parentName:"li"},"Grant type allowed:")," ",Object(r.b)("inlineCode",{parentName:"li"},"Authorization Code")," and ",Object(r.b)("inlineCode",{parentName:"li"},"Refresh Token")))),Object(r.b)("li",{parentName:"ol"},"Make note of the ",Object(r.b)("inlineCode",{parentName:"li"},"Client ID")," and ",Object(r.b)("inlineCode",{parentName:"li"},"Client secret"),", they are needed in a future step"),Object(r.b)("li",{parentName:"ol"},"Make note of the ",Object(r.b)("strong",{parentName:"li"},"default")," Authorization Server Issuer URI from: https://${your-okta-domain}/admin/oauth2/as"),Object(r.b)("li",{parentName:"ol"},"Example config file ",Object(r.b)("inlineCode",{parentName:"li"},"/etc/localhost.cfg"),Object(r.b)("pre",{parentName:"li"},Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'provider = "oidc"\nredirect_url = "http://localhost:4180/oauth2/callback"\noidc_issuer_url = "https://${your-okta-domain}/oauth2/default"\nupstreams = [\n "http://0.0.0.0:8080"\n]\nemail_domains = [\n "*"\n]\nclient_id = "XXX"\nclient_secret = "YYY"\npass_access_token = true\ncookie_secret = "ZZZ"\ncookie_secure = false\nskip_provider_button = true\n# Note: use the following for testing within a container\n# http_address = "0.0.0.0:4180"\n'))),Object(r.b)("li",{parentName:"ol"},"Then you can start the oauth2-proxy with ",Object(r.b)("inlineCode",{parentName:"li"},"./oauth2-proxy --config /etc/localhost.cfg"))),Object(r.b)("h3",{id:"logingov-provider"},"login.gov Provider"),Object(r.b)("p",null,"login.gov is an OIDC provider for the US Government.\nIf you are a US Government agency, you can contact the login.gov team through the contact information\nthat you can find on ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://login.gov/developers/"}),"https://login.gov/developers/")," and work with them to understand how to get login.gov\naccounts for integration/test and production access."),Object(r.b)("p",null,"A developer guide is available here: ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://developers.login.gov/"}),"https://developers.login.gov/"),", though this proxy handles everything\nbut the data you need to create to register your application in the login.gov dashboard."),Object(r.b)("p",null,"As a demo, we will assume that you are running your application that you want to secure locally on\nhttp://localhost:3000/, that you will be starting your proxy up on http://localhost:4180/, and that\nyou have an agency integration account for testing."),Object(r.b)("p",null,"First, register your application in the dashboard. The important bits are:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Identity protocol: make this ",Object(r.b)("inlineCode",{parentName:"li"},"Openid connect")),Object(r.b)("li",{parentName:"ul"},"Issuer: do what they say for OpenID Connect. We will refer to this string as ",Object(r.b)("inlineCode",{parentName:"li"},"${LOGINGOV_ISSUER}"),"."),Object(r.b)("li",{parentName:"ul"},"Public key: This is a self-signed certificate in .pem format generated from a 2048 bit RSA private key.\nA quick way to do this is ",Object(r.b)("inlineCode",{parentName:"li"},"openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3650 -nodes -subj '/C=US/ST=Washington/L=DC/O=GSA/OU=18F/CN=localhost'"),",\nThe contents of the ",Object(r.b)("inlineCode",{parentName:"li"},"key.pem")," shall be referred to as ",Object(r.b)("inlineCode",{parentName:"li"},"${OAUTH2_PROXY_JWT_KEY}"),"."),Object(r.b)("li",{parentName:"ul"},"Return to App URL: Make this be ",Object(r.b)("inlineCode",{parentName:"li"},"http://localhost:4180/")),Object(r.b)("li",{parentName:"ul"},"Redirect URIs: Make this be ",Object(r.b)("inlineCode",{parentName:"li"},"http://localhost:4180/oauth2/callback"),"."),Object(r.b)("li",{parentName:"ul"},"Attribute Bundle: Make sure that email is selected.")),Object(r.b)("p",null,"Now start the proxy up with the following options:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),'./oauth2-proxy -provider login.gov \\\n -client-id=${LOGINGOV_ISSUER} \\\n -redirect-url=http://localhost:4180/oauth2/callback \\\n -oidc-issuer-url=https://idp.int.identitysandbox.gov/ \\\n -cookie-secure=false \\\n -email-domain=gsa.gov \\\n -upstream=http://localhost:3000/ \\\n -cookie-secret=somerandomstring12341234567890AB \\\n -cookie-domain=localhost \\\n -skip-provider-button=true \\\n -pubjwk-url=https://idp.int.identitysandbox.gov/api/openid_connect/certs \\\n -profile-url=https://idp.int.identitysandbox.gov/api/openid_connect/userinfo \\\n -jwt-key="${OAUTH2_PROXY_JWT_KEY}"\n')),Object(r.b)("p",null,"You can also set all these options with environment variables, for use in cloud/docker environments.\nOne tricky thing that you may encounter is that some cloud environments will pass in environment\nvariables in a docker env-file, which does not allow multiline variables like a PEM file.\nIf you encounter this, then you can create a ",Object(r.b)("inlineCode",{parentName:"p"},"jwt_signing_key.pem")," file in the top level\ndirectory of the repo which contains the key in PEM format and then do your docker build.\nThe docker build process will copy that file into your image which you can then access by\nsetting the ",Object(r.b)("inlineCode",{parentName:"p"},"OAUTH2_PROXY_JWT_KEY_FILE=/etc/ssl/private/jwt_signing_key.pem"),"\nenvironment variable, or by setting ",Object(r.b)("inlineCode",{parentName:"p"},"--jwt-key-file=/etc/ssl/private/jwt_signing_key.pem")," on the commandline."),Object(r.b)("p",null,"Once it is running, you should be able to go to ",Object(r.b)("inlineCode",{parentName:"p"},"http://localhost:4180/")," in your browser,\nget authenticated by the login.gov integration server, and then get proxied on to your\napplication running on ",Object(r.b)("inlineCode",{parentName:"p"},"http://localhost:3000/"),". In a real deployment, you would secure\nyour application with a firewall or something so that it was only accessible from the\nproxy, and you would use real hostnames everywhere."),Object(r.b)("h4",{id:"skip-oidc-discovery"},"Skip OIDC discovery"),Object(r.b)("p",null,"Some providers do not support OIDC discovery via their issuer URL, so oauth2-proxy cannot simply grab the authorization, token and jwks URI endpoints from the provider's metadata."),Object(r.b)("p",null,"In this case, you can set the ",Object(r.b)("inlineCode",{parentName:"p"},"--skip-oidc-discovery")," option, and supply those required endpoints manually:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{})," -provider oidc\n -client-id oauth2-proxy\n -client-secret proxy\n -redirect-url http://127.0.0.1:4180/oauth2/callback\n -oidc-issuer-url http://127.0.0.1:5556\n -skip-oidc-discovery\n -login-url http://127.0.0.1:5556/authorize\n -redeem-url http://127.0.0.1:5556/token\n -oidc-jwks-url http://127.0.0.1:5556/keys\n -cookie-secure=false\n -email-domain example.com\n")),Object(r.b)("h3",{id:"nextcloud-provider"},"Nextcloud Provider"),Object(r.b)("p",null,"The Nextcloud provider allows you to authenticate against users in your\nNextcloud instance."),Object(r.b)("p",null,"When you are using the Nextcloud provider, you must specify the urls via\nconfiguration, environment variable, or command line argument. Depending\non whether your Nextcloud instance is using pretty urls your urls may be of the\nform ",Object(r.b)("inlineCode",{parentName:"p"},"/index.php/apps/oauth2/*")," or ",Object(r.b)("inlineCode",{parentName:"p"},"/apps/oauth2/*"),"."),Object(r.b)("p",null,"Refer to the ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/oauth2.html"}),"OAuth2\ndocumentation"),'\nto setup the client id and client secret. Your "Redirection URI" will be\n',Object(r.b)("inlineCode",{parentName:"p"},"https://internalapp.yourcompany.com/oauth2/callback"),"."),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),' -provider nextcloud\n -client-id \n -client-secret \n -login-url="/index.php/apps/oauth2/authorize"\n -redeem-url="/index.php/apps/oauth2/api/v1/token"\n -validate-url="/ocs/v2.php/cloud/user?format=json"\n')),Object(r.b)("p",null,"Note: in ",Object(r.b)("em",{parentName:"p"},"all")," cases the validate-url will ",Object(r.b)("em",{parentName:"p"},"not")," have the ",Object(r.b)("inlineCode",{parentName:"p"},"index.php"),"."),Object(r.b)("h3",{id:"digitalocean-auth-provider"},"DigitalOcean Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://cloud.digitalocean.com/account/api/applications"}),"Create a new OAuth application"),Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},"You can fill in the name, homepage, and description however you wish."),Object(r.b)("li",{parentName:"ul"},'In the "Application callback URL" field, enter: ',Object(r.b)("inlineCode",{parentName:"li"},"https://oauth-proxy/oauth2/callback"),", substituting ",Object(r.b)("inlineCode",{parentName:"li"},"oauth2-proxy")," with the actual hostname that oauth2-proxy is running on. The URL must match oauth2-proxy's configured redirect URL."))),Object(r.b)("li",{parentName:"ol"},"Note the Client ID and Client Secret.")),Object(r.b)("p",null,"To use the provider, pass the following options:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{})," --provider=digitalocean\n --client-id=\n --client-secret=\n")),Object(r.b)("p",null," Alternatively, set the equivalent options in the config file. The redirect URL defaults to ",Object(r.b)("inlineCode",{parentName:"p"},"https:///oauth2/callback"),". If you need to change it, you can use the ",Object(r.b)("inlineCode",{parentName:"p"},"--redirect-url")," command-line option."),Object(r.b)("h3",{id:"bitbucket-auth-provider"},"Bitbucket Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},Object(r.b)("a",Object(o.a)({parentName:"li"},{href:"https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html"}),"Add a new OAuth consumer"),Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},'In "Callback URL" use ',Object(r.b)("inlineCode",{parentName:"li"},"https:///oauth2/callback"),", substituting ",Object(r.b)("inlineCode",{parentName:"li"},"")," with the actual hostname that oauth2-proxy is running on."),Object(r.b)("li",{parentName:"ul"},"In Permissions section select:",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},"Account -> Email"),Object(r.b)("li",{parentName:"ul"},"Team membership -> Read"),Object(r.b)("li",{parentName:"ul"},"Repositories -> Read"))))),Object(r.b)("li",{parentName:"ol"},"Note the Client ID and Client Secret.")),Object(r.b)("p",null,"To use the provider, pass the following options:"),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{})," --provider=bitbucket\n --client-id=\n --client-secret=\n")),Object(r.b)("p",null,"The default configuration allows everyone with Bitbucket account to authenticate. To restrict the access to the team members use additional configuration option: ",Object(r.b)("inlineCode",{parentName:"p"},"--bitbucket-team="),". To restrict the access to only these users who has access to one selected repository use ",Object(r.b)("inlineCode",{parentName:"p"},"--bitbucket-repository="),"."),Object(r.b)("h3",{id:"gitea-auth-provider"},"Gitea Auth Provider"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"Create a new application: ",Object(r.b)("inlineCode",{parentName:"li"},"https://< your gitea host >/user/settings/applications")),Object(r.b)("li",{parentName:"ol"},"Under ",Object(r.b)("inlineCode",{parentName:"li"},"Redirect URI")," enter the correct URL i.e. ",Object(r.b)("inlineCode",{parentName:"li"},"https:///oauth2/callback")),Object(r.b)("li",{parentName:"ol"},"Note the Client ID and Client Secret."),Object(r.b)("li",{parentName:"ol"},"Pass the following options to the proxy:")),Object(r.b)("pre",null,Object(r.b)("code",Object(o.a)({parentName:"pre"},{}),' --provider="github"\n --redirect-url="https:///oauth2/callback"\n --provider-display-name="Gitea"\n --client-id="< client_id as generated by Gitea >"\n --client-secret="< client_secret as generated by Gitea >"\n --login-url="https://< your gitea host >/login/oauth/authorize"\n --redeem-url="https://< your gitea host >/login/oauth/access_token"\n --validate-url="https://< your gitea host >/api/v1"\n')),Object(r.b)("h2",{id:"email-authentication"},"Email Authentication"),Object(r.b)("p",null,"To authorize by email domain use ",Object(r.b)("inlineCode",{parentName:"p"},"--email-domain=yourcompany.com"),". To authorize individual email addresses use ",Object(r.b)("inlineCode",{parentName:"p"},"--authenticated-emails-file=/path/to/file")," with one email per line. To authorize all email addresses use ",Object(r.b)("inlineCode",{parentName:"p"},"--email-domain=*"),"."),Object(r.b)("h2",{id:"adding-a-new-provider"},"Adding a new Provider"),Object(r.b)("p",null,"Follow the examples in the ",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/oauth2-proxy/oauth2-proxy/blob/master/providers/"}),Object(r.b)("inlineCode",{parentName:"a"},"providers")," package")," to define a new\n",Object(r.b)("inlineCode",{parentName:"p"},"Provider")," instance. Add a new ",Object(r.b)("inlineCode",{parentName:"p"},"case")," to\n",Object(r.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/oauth2-proxy/oauth2-proxy/blob/master/providers/providers.go"}),Object(r.b)("inlineCode",{parentName:"a"},"providers.New()"))," to allow ",Object(r.b)("inlineCode",{parentName:"p"},"oauth2-proxy")," to use the\nnew ",Object(r.b)("inlineCode",{parentName:"p"},"Provider"),"."))}b.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/404.html b/404.html index cda9395d..6063a2de 100644 --- a/404.html +++ b/404.html @@ -6,14 +6,14 @@ Page Not Found | OAuth2 Proxy - - + +
-

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

Copyright © 2021 OAuth2 Proxy.
+

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

Copyright © 2022 OAuth2 Proxy.
- - + + \ No newline at end of file diff --git a/docs/6.1.x/behaviour/index.html b/docs/6.1.x/behaviour/index.html index 2ae47668..1ee7fd62 100644 --- a/docs/6.1.x/behaviour/index.html +++ b/docs/6.1.x/behaviour/index.html @@ -6,8 +6,8 @@ Behaviour | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
-
Version: 6.1.x

Behaviour

  1. Any request passing through the proxy (and not matched by --skip-auth-regex) is checked for the proxy's session cookie (--cookie-name) (or, if allowed, a JWT token - see --skip-jwt-bearer-tokens).
  2. If authentication is required but missing then the user is asked to log in and redirected to the authentication provider (unless it is an Ajax request, i.e. one with Accept: application/json, in which case 401 Unauthorized is returned)
  3. After returning from the authentication provider, the oauth tokens are stored in the configured session store (cookie, redis, ...) and a cookie is set
  4. The request is forwarded to the upstream server with added user info and authentication headers (depending on the configuration)

Notice that the proxy also provides a number of useful endpoints.

Copyright © 2021 OAuth2 Proxy.
+
Version: 6.1.x

Behaviour

  1. Any request passing through the proxy (and not matched by --skip-auth-regex) is checked for the proxy's session cookie (--cookie-name) (or, if allowed, a JWT token - see --skip-jwt-bearer-tokens).
  2. If authentication is required but missing then the user is asked to log in and redirected to the authentication provider (unless it is an Ajax request, i.e. one with Accept: application/json, in which case 401 Unauthorized is returned)
  3. After returning from the authentication provider, the oauth tokens are stored in the configured session store (cookie, redis, ...) and a cookie is set
  4. The request is forwarded to the upstream server with added user info and authentication headers (depending on the configuration)

Notice that the proxy also provides a number of useful endpoints.

Copyright © 2022 OAuth2 Proxy.
- - + + diff --git a/docs/6.1.x/community/security/index.html b/docs/6.1.x/community/security/index.html index 8667b98b..9fa363b2 100644 --- a/docs/6.1.x/community/security/index.html +++ b/docs/6.1.x/community/security/index.html @@ -6,8 +6,8 @@ Security | OAuth2 Proxy - - + + @@ -36,10 +36,10 @@ dependencies), we may use regular PRs for fixes and forego the security advisory If we have multiple security issues in flight simultaneously, we may delay merging fixes until all patches are ready. We may also backport the fix to previous releases, -but this will be at the discretion of the maintainers.

Copyright © 2021 OAuth2 Proxy.
+but this will be at the discretion of the maintainers.

Copyright © 2022 OAuth2 Proxy.
- - + + diff --git a/docs/6.1.x/configuration/oauth_provider/index.html b/docs/6.1.x/configuration/oauth_provider/index.html index 9f06fdb1..12c41df8 100644 --- a/docs/6.1.x/configuration/oauth_provider/index.html +++ b/docs/6.1.x/configuration/oauth_provider/index.html @@ -6,8 +6,8 @@ OAuth Provider Configuration | OAuth2 Proxy - - + + @@ -53,10 +53,10 @@ to setup the client id and client secret. Your "Redirection URI" will https://internalapp.yourcompany.com/oauth2/callback.

-provider nextcloud
-client-id <from nextcloud admin>
-client-secret <from nextcloud admin>
-login-url="<your nextcloud url>/index.php/apps/oauth2/authorize"
-redeem-url="<your nextcloud url>/index.php/apps/oauth2/api/v1/token"
-validate-url="<your nextcloud url>/ocs/v2.php/cloud/user?format=json"

Note: in all cases the validate-url will not have the index.php.

DigitalOcean Auth Provider

  1. Create a new OAuth application
    • You can fill in the name, homepage, and description however you wish.
    • In the "Application callback URL" field, enter: https://oauth-proxy/oauth2/callback, substituting oauth2-proxy with the actual hostname that oauth2-proxy is running on. The URL must match oauth2-proxy's configured redirect URL.
  2. Note the Client ID and Client Secret.

To use the provider, pass the following options:

--provider=digitalocean
--client-id=<Client ID>
--client-secret=<Client Secret>

Alternatively, set the equivalent options in the config file. The redirect URL defaults to https://<requested host header>/oauth2/callback. If you need to change it, you can use the --redirect-url command-line option.

Bitbucket Auth Provider

  1. Add a new OAuth consumer
    • In "Callback URL" use https://<oauth2-proxy>/oauth2/callback, substituting <oauth2-proxy> with the actual hostname that oauth2-proxy is running on.
    • In Permissions section select:
      • Account -> Email
      • Team membership -> Read
      • Repositories -> Read
  2. Note the Client ID and Client Secret.

To use the provider, pass the following options:

--provider=bitbucket
--client-id=<Client ID>
--client-secret=<Client Secret>

The default configuration allows everyone with Bitbucket account to authenticate. To restrict the access to the team members use additional configuration option: --bitbucket-team=<Team name>. To restrict the access to only these users who has access to one selected repository use --bitbucket-repository=<Repository name>.

Gitea Auth Provider

  1. Create a new application: https://< your gitea host >/user/settings/applications
  2. Under Redirect URI enter the correct URL i.e. https://<proxied host>/oauth2/callback
  3. Note the Client ID and Client Secret.
  4. Pass the following options to the proxy:
--provider="github"
--redirect-url="https://<proxied host>/oauth2/callback"
--provider-display-name="Gitea"
--client-id="< client_id as generated by Gitea >"
--client-secret="< client_secret as generated by Gitea >"
--login-url="https://< your gitea host >/login/oauth/authorize"
--redeem-url="https://< your gitea host >/login/oauth/access_token"
--validate-url="https://< your gitea host >/api/v1"

Email Authentication

To authorize by email domain use --email-domain=yourcompany.com. To authorize individual email addresses use --authenticated-emails-file=/path/to/file with one email per line. To authorize all email addresses use --email-domain=*.

Adding a new Provider

Follow the examples in the providers package to define a new Provider instance. Add a new case to providers.New() to allow oauth2-proxy to use the -new Provider.

Copyright © 2021 OAuth2 Proxy.
+new Provider.

Copyright © 2022 OAuth2 Proxy.
- - + + diff --git a/docs/6.1.x/configuration/overview/index.html b/docs/6.1.x/configuration/overview/index.html index 097ce18f..c522c0c8 100644 --- a/docs/6.1.x/configuration/overview/index.html +++ b/docs/6.1.x/configuration/overview/index.html @@ -6,8 +6,8 @@ Overview | OAuth2 Proxy - - + + @@ -37,10 +37,10 @@ The default format is configured as follows:

<
proxy_pass http://backend/;
# or "root /path/to/site;" or "fastcgi_pass ..." etc
}
}

When you use ingress-nginx in Kubernetes, you MUST use kubernetes/ingress-nginx (which includes the Lua module) and the following configuration snippet for your Ingress. Variables set with auth_request_set are not set-able in plain nginx config when the location is processed via proxy_pass and then may only be processed by Lua. Note that nginxinc/kubernetes-ingress does not include the Lua module.

nginx.ingress.kubernetes.io/auth-response-headers: Authorization
nginx.ingress.kubernetes.io/auth-signin: https://$host/oauth2/start?rd=$escaped_request_uri
nginx.ingress.kubernetes.io/auth-url: https://$host/oauth2/auth
nginx.ingress.kubernetes.io/configuration-snippet: |
auth_request_set $name_upstream_1 $upstream_cookie_name_1;
-
access_by_lua_block {
if ngx.var.name_upstream_1 ~= "" then
ngx.header["Set-Cookie"] = "name_1=" .. ngx.var.name_upstream_1 .. ngx.var.auth_cookie:match("(; .*)")
end
}

It is recommended to use --session-store-type=redis when expecting large sessions/OIDC tokens (e.g. with MS Azure).

You have to substitute name with the actual cookie name you configured via --cookie-name parameter. If you don't set a custom cookie name the variable should be "$upstream_cookie__oauth2_proxy_1" instead of "$upstream_cookie_name_1" and the new cookie-name should be "_oauth2_proxy_1=" instead of "name_1=".

note

If you set up your OAuth2 provider to rotate your client secret, you can use the client-secret-file option to reload the secret when it is updated.

Copyright © 2021 OAuth2 Proxy.
+
access_by_lua_block {
if ngx.var.name_upstream_1 ~= "" then
ngx.header["Set-Cookie"] = "name_1=" .. ngx.var.name_upstream_1 .. ngx.var.auth_cookie:match("(; .*)")
end
}

It is recommended to use --session-store-type=redis when expecting large sessions/OIDC tokens (e.g. with MS Azure).

You have to substitute name with the actual cookie name you configured via --cookie-name parameter. If you don't set a custom cookie name the variable should be "$upstream_cookie__oauth2_proxy_1" instead of "$upstream_cookie_name_1" and the new cookie-name should be "_oauth2_proxy_1=" instead of "name_1=".

note

If you set up your OAuth2 provider to rotate your client secret, you can use the client-secret-file option to reload the secret when it is updated.

Copyright © 2022 OAuth2 Proxy.
- - + + diff --git a/docs/6.1.x/configuration/session_storage/index.html b/docs/6.1.x/configuration/session_storage/index.html index 19319fe0..bf01cacc 100644 --- a/docs/6.1.x/configuration/session_storage/index.html +++ b/docs/6.1.x/configuration/session_storage/index.html @@ -6,8 +6,8 @@ Session Storage | OAuth2 Proxy - - + + @@ -33,10 +33,10 @@ disclosure.

Copyright © 2021 OAuth2 Proxy.
+--redis-use-cluster=true flag, and configure the flags --redis-cluster-connection-urls appropriately.

Note that flags --redis-use-sentinel=true and --redis-use-cluster=true are mutually exclusive.

Copyright © 2022 OAuth2 Proxy.
- - + + diff --git a/docs/6.1.x/configuration/tls/index.html b/docs/6.1.x/configuration/tls/index.html index f5028d82..d6c75750 100644 --- a/docs/6.1.x/configuration/tls/index.html +++ b/docs/6.1.x/configuration/tls/index.html @@ -6,8 +6,8 @@ TLS Configuration | OAuth2 Proxy - - + + @@ -24,10 +24,10 @@ external load balancer like Amazon ELB or Google Platform Load Balancing) use oauth2-proxy will then authenticate requests for an upstream application. The external endpoint for this example would be https://internal.yourcompany.com/.

An example Nginx config follows. Note the use of Strict-Transport-Security header to pin requests to SSL via HSTS:

server {
listen 443 default ssl;
server_name internal.yourcompany.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/cert.key;
add_header Strict-Transport-Security max-age=2592000;
-
location / {
proxy_pass http://127.0.0.1:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 1;
proxy_send_timeout 30;
proxy_read_timeout 30;
}
}

The command line to run oauth2-proxy in this configuration would look like this:

./oauth2-proxy \
--email-domain="yourcompany.com" \
--upstream=http://127.0.0.1:8080/ \
--cookie-secret=... \
--cookie-secure=true \
--provider=... \
--reverse-proxy=true \
--client-id=... \
--client-secret=...
Copyright © 2021 OAuth2 Proxy.
+
location / {
proxy_pass http://127.0.0.1:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 1;
proxy_send_timeout 30;
proxy_read_timeout 30;
}
}

The command line to run oauth2-proxy in this configuration would look like this:

./oauth2-proxy \
--email-domain="yourcompany.com" \
--upstream=http://127.0.0.1:8080/ \
--cookie-secret=... \
--cookie-secure=true \
--provider=... \
--reverse-proxy=true \
--client-id=... \
--client-secret=...
Copyright © 2022 OAuth2 Proxy.
- - + + diff --git a/docs/6.1.x/features/endpoints/index.html b/docs/6.1.x/features/endpoints/index.html index 91388473..ba19577b 100644 --- a/docs/6.1.x/features/endpoints/index.html +++ b/docs/6.1.x/features/endpoints/index.html @@ -6,8 +6,8 @@ Endpoints | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
-
Version: 6.1.x

Endpoints

OAuth2 Proxy responds directly to the following endpoints. All other endpoints will be proxied upstream when authenticated. The /oauth2 prefix can be changed with the --proxy-prefix config variable.

  • /robots.txt - returns a 200 OK response that disallows all User-agents from all paths; see robotstxt.org for more info
  • /ping - returns a 200 OK response, which is intended for use with health checks
  • /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
  • /oauth2/sign_out - this URL is used to clear the session cookie
  • /oauth2/start - a URL that will redirect to start the OAuth cycle
  • /oauth2/callback - the URL used at the end of the OAuth cycle. The oauth app will be configured with this as the callback url.
  • /oauth2/userinfo - the URL is used to return user's email from the session in JSON format.
  • /oauth2/auth - only returns a 202 Accepted response or a 401 Unauthorized response; for use with the Nginx auth_request directive

Sign out

To sign the user out, redirect them to /oauth2/sign_out. This endpoint only removes oauth2-proxy's own cookies, i.e. the user is still logged in with the authentication provider and may automatically re-login when accessing the application again. You will also need to redirect the user to the authentication provider's sign out page afterwards using the rd query parameter, i.e. redirect the user to something like (notice the url-encoding!):

/oauth2/sign_out?rd=https%3A%2F%2Fmy-oidc-provider.example.com%2Fsign_out_page

Alternatively, include the redirect URL in the X-Auth-Request-Redirect header:

GET /oauth2/sign_out HTTP/1.1
X-Auth-Request-Redirect: https://my-oidc-provider/sign_out_page
...

(The "sign_out_page" should be the end_session_endpoint from the metadata if your OIDC provider supports Session Management and Discovery.)

BEWARE that the domain you want to redirect to (my-oidc-provider.example.com in the example) must be added to the --whitelist-domain configuration option otherwise the redirect will be ignored.

Copyright © 2021 OAuth2 Proxy.
+
Version: 6.1.x

Endpoints

OAuth2 Proxy responds directly to the following endpoints. All other endpoints will be proxied upstream when authenticated. The /oauth2 prefix can be changed with the --proxy-prefix config variable.

  • /robots.txt - returns a 200 OK response that disallows all User-agents from all paths; see robotstxt.org for more info
  • /ping - returns a 200 OK response, which is intended for use with health checks
  • /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
  • /oauth2/sign_out - this URL is used to clear the session cookie
  • /oauth2/start - a URL that will redirect to start the OAuth cycle
  • /oauth2/callback - the URL used at the end of the OAuth cycle. The oauth app will be configured with this as the callback url.
  • /oauth2/userinfo - the URL is used to return user's email from the session in JSON format.
  • /oauth2/auth - only returns a 202 Accepted response or a 401 Unauthorized response; for use with the Nginx auth_request directive

Sign out

To sign the user out, redirect them to /oauth2/sign_out. This endpoint only removes oauth2-proxy's own cookies, i.e. the user is still logged in with the authentication provider and may automatically re-login when accessing the application again. You will also need to redirect the user to the authentication provider's sign out page afterwards using the rd query parameter, i.e. redirect the user to something like (notice the url-encoding!):

/oauth2/sign_out?rd=https%3A%2F%2Fmy-oidc-provider.example.com%2Fsign_out_page

Alternatively, include the redirect URL in the X-Auth-Request-Redirect header:

GET /oauth2/sign_out HTTP/1.1
X-Auth-Request-Redirect: https://my-oidc-provider/sign_out_page
...

(The "sign_out_page" should be the end_session_endpoint from the metadata if your OIDC provider supports Session Management and Discovery.)

BEWARE that the domain you want to redirect to (my-oidc-provider.example.com in the example) must be added to the --whitelist-domain configuration option otherwise the redirect will be ignored.

Copyright © 2022 OAuth2 Proxy.
- - + + diff --git a/docs/6.1.x/features/request_signatures/index.html b/docs/6.1.x/features/request_signatures/index.html index c6bb6f20..f1f6ce66 100644 --- a/docs/6.1.x/features/request_signatures/index.html +++ b/docs/6.1.x/features/request_signatures/index.html @@ -6,8 +6,8 @@ Request Signatures | OAuth2 Proxy - - + + @@ -25,10 +25,10 @@ of selected request information and the request body Amazon Web Services: Signing and Authenticating REST Requests
  • rc3.org: Using HMAC to authenticate Web service -requests
  • Copyright © 2021 OAuth2 Proxy.
    +requests
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/6.1.x/index.html b/docs/6.1.x/index.html index 471960be..e2d04291 100644 --- a/docs/6.1.x/index.html +++ b/docs/6.1.x/index.html @@ -6,8 +6,8 @@ Installation | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: 6.1.x

    Installation

    1. Choose how to deploy:

      a. Download Prebuilt Binary (current release is v6.1.1)

      b. Build with $ go get github.com/oauth2-proxy/oauth2-proxy which will put the binary in $GOPATH/bin

      c. Using the prebuilt docker image quay.io/oauth2-proxy/oauth2-proxy (AMD64, ARMv6 and ARM64 tags available)

    Prebuilt binaries can be validated by extracting the file and verifying it against the sha256sum.txt checksum file provided for each release starting with version v3.0.0.

    $ sha256sum -c sha256sum.txt 2>&1 | grep OK
    oauth2-proxy-x.y.z.linux-amd64: OK
    1. Select a Provider and Register an OAuth Application with a Provider
    2. Configure OAuth2 Proxy using config file, command line options, or environment variables
    3. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
    Copyright © 2021 OAuth2 Proxy.
    +
    Version: 6.1.x

    Installation

    1. Choose how to deploy:

      a. Download Prebuilt Binary (current release is v6.1.1)

      b. Build with $ go get github.com/oauth2-proxy/oauth2-proxy which will put the binary in $GOPATH/bin

      c. Using the prebuilt docker image quay.io/oauth2-proxy/oauth2-proxy (AMD64, ARMv6 and ARM64 tags available)

    Prebuilt binaries can be validated by extracting the file and verifying it against the sha256sum.txt checksum file provided for each release starting with version v3.0.0.

    $ sha256sum -c sha256sum.txt 2>&1 | grep OK
    oauth2-proxy-x.y.z.linux-amd64: OK
    1. Select a Provider and Register an OAuth Application with a Provider
    2. Configure OAuth2 Proxy using config file, command line options, or environment variables
    3. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.0.x/behaviour/index.html b/docs/7.0.x/behaviour/index.html index 47dbc69f..dd614d7f 100644 --- a/docs/7.0.x/behaviour/index.html +++ b/docs/7.0.x/behaviour/index.html @@ -6,8 +6,8 @@ Behaviour | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: 7.0.x

    Behaviour

    1. Any request passing through the proxy (and not matched by --skip-auth-regex) is checked for the proxy's session cookie (--cookie-name) (or, if allowed, a JWT token - see --skip-jwt-bearer-tokens).
    2. If authentication is required but missing then the user is asked to log in and redirected to the authentication provider (unless it is an Ajax request, i.e. one with Accept: application/json, in which case 401 Unauthorized is returned)
    3. After returning from the authentication provider, the oauth tokens are stored in the configured session store (cookie, redis, ...) and a cookie is set
    4. The request is forwarded to the upstream server with added user info and authentication headers (depending on the configuration)

    Notice that the proxy also provides a number of useful endpoints.

    Copyright © 2021 OAuth2 Proxy.
    +
    Version: 7.0.x

    Behaviour

    1. Any request passing through the proxy (and not matched by --skip-auth-regex) is checked for the proxy's session cookie (--cookie-name) (or, if allowed, a JWT token - see --skip-jwt-bearer-tokens).
    2. If authentication is required but missing then the user is asked to log in and redirected to the authentication provider (unless it is an Ajax request, i.e. one with Accept: application/json, in which case 401 Unauthorized is returned)
    3. After returning from the authentication provider, the oauth tokens are stored in the configured session store (cookie, redis, ...) and a cookie is set
    4. The request is forwarded to the upstream server with added user info and authentication headers (depending on the configuration)

    Notice that the proxy also provides a number of useful endpoints.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.0.x/community/security/index.html b/docs/7.0.x/community/security/index.html index c2738ad6..6a29a893 100644 --- a/docs/7.0.x/community/security/index.html +++ b/docs/7.0.x/community/security/index.html @@ -6,8 +6,8 @@ Security | OAuth2 Proxy - - + + @@ -36,10 +36,10 @@ dependencies), we may use regular PRs for fixes and forego the security advisory If we have multiple security issues in flight simultaneously, we may delay merging fixes until all patches are ready. We may also backport the fix to previous releases, -but this will be at the discretion of the maintainers.

    Copyright © 2021 OAuth2 Proxy.
    +but this will be at the discretion of the maintainers.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.0.x/configuration/alpha-config/index.html b/docs/7.0.x/configuration/alpha-config/index.html index 47aba862..d6a6bcb0 100644 --- a/docs/7.0.x/configuration/alpha-config/index.html +++ b/docs/7.0.x/configuration/alpha-config/index.html @@ -6,8 +6,8 @@ Alpha Configuration | OAuth2 Proxy - - + + @@ -42,10 +42,10 @@ Valid time units are "ns", "us" (or "µs"), " response header.

    FieldTypeDescription
    namestringName is the header name to be used for this set of values.
    Names should be unique within a list of Headers.
    preserveRequestValueboolPreserveRequestValue determines whether any values for this header
    should be preserved for the request to the upstream server.
    This option only applies to injected request headers.
    Defaults to false (headers that match this header will be stripped).
    values[]HeaderValueValues contains the desired values for this header

    HeaderValue

    (Appears on: Header)

    HeaderValue represents a single header value and the sources that can make up the header value

    FieldTypeDescription
    value[]byteValue expects a base64 encoded string value.
    fromEnvstringFromEnv expects the name of an environment variable.
    fromFilestringFromFile expects a path to a file containing the secret value.
    claimstringClaim is the name of the claim in the session that the value should be
    loaded from.
    prefixstringPrefix is an optional prefix that will be prepended to the value of the
    claim if it is non-empty.
    basicAuthPasswordSecretSourceBasicAuthPassword converts this claim into a basic auth header.
    Note the value of claim will become the basic auth username and the
    basicAuthPassword will be used as the password value.

    SecretSource

    (Appears on: ClaimSource, HeaderValue)

    SecretSource references an individual secret value. Only one source within the struct should be defined at any time.

    FieldTypeDescription
    value[]byteValue expects a base64 encoded string value.
    fromEnvstringFromEnv expects the name of an environment variable.
    fromFilestringFromFile expects a path to a file containing the secret value.

    Upstream

    (Appears on: Upstreams)

    Upstream represents the configuration for an upstream server. -Requests will be proxied to this upstream if the path matches the request path.

    FieldTypeDescription
    idstringID should be a unique identifier for the upstream.
    This value is required for all upstreams.
    pathstringPath is used to map requests to the upstream server.
    The closest match will take precedence and all Paths must be unique.
    uristringThe URI of the upstream server. This may be an HTTP(S) server of a File
    based URL. It may include a path, in which case all requests will be served
    under that path.
    Eg:
    - http://localhost:8080
    - https://service.localhost
    - https://service.localhost/path
    - file://host/path
    If the URI's path is "/base" and the incoming request was for "/dir",
    the upstream request will be for "/base/dir".
    insecureSkipTLSVerifyboolInsecureSkipTLSVerify will skip TLS verification of upstream HTTPS hosts.
    This option is insecure and will allow potential Man-In-The-Middle attacks
    betweem OAuth2 Proxy and the usptream server.
    Defaults to false.
    staticboolStatic will make all requests to this upstream have a static response.
    The response will have a body of "Authenticated" and a response code
    matching StaticCode.
    If StaticCode is not set, the response will return a 200 response.
    staticCodeintStaticCode determines the response code for the Static response.
    This option can only be used with Static enabled.
    flushIntervalDurationFlushInterval is the period between flushing the response buffer when
    streaming response from the upstream.
    Defaults to 1 second.
    passHostHeaderboolPassHostHeader determines whether the request host header should be proxied
    to the upstream server.
    Defaults to true.
    proxyWebSocketsboolProxyWebSockets enables proxying of websockets to upstream servers
    Defaults to true.

    Upstreams

    ([]Upstream alias)

    (Appears on: AlphaOptions)

    Upstreams is a collection of definitions for upstream servers.

    Copyright © 2021 OAuth2 Proxy.
    +Requests will be proxied to this upstream if the path matches the request path.

    FieldTypeDescription
    idstringID should be a unique identifier for the upstream.
    This value is required for all upstreams.
    pathstringPath is used to map requests to the upstream server.
    The closest match will take precedence and all Paths must be unique.
    uristringThe URI of the upstream server. This may be an HTTP(S) server of a File
    based URL. It may include a path, in which case all requests will be served
    under that path.
    Eg:
    - http://localhost:8080
    - https://service.localhost
    - https://service.localhost/path
    - file://host/path
    If the URI's path is "/base" and the incoming request was for "/dir",
    the upstream request will be for "/base/dir".
    insecureSkipTLSVerifyboolInsecureSkipTLSVerify will skip TLS verification of upstream HTTPS hosts.
    This option is insecure and will allow potential Man-In-The-Middle attacks
    betweem OAuth2 Proxy and the usptream server.
    Defaults to false.
    staticboolStatic will make all requests to this upstream have a static response.
    The response will have a body of "Authenticated" and a response code
    matching StaticCode.
    If StaticCode is not set, the response will return a 200 response.
    staticCodeintStaticCode determines the response code for the Static response.
    This option can only be used with Static enabled.
    flushIntervalDurationFlushInterval is the period between flushing the response buffer when
    streaming response from the upstream.
    Defaults to 1 second.
    passHostHeaderboolPassHostHeader determines whether the request host header should be proxied
    to the upstream server.
    Defaults to true.
    proxyWebSocketsboolProxyWebSockets enables proxying of websockets to upstream servers
    Defaults to true.

    Upstreams

    ([]Upstream alias)

    (Appears on: AlphaOptions)

    Upstreams is a collection of definitions for upstream servers.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.0.x/configuration/oauth_provider/index.html b/docs/7.0.x/configuration/oauth_provider/index.html index 00788696..0c2aedd4 100644 --- a/docs/7.0.x/configuration/oauth_provider/index.html +++ b/docs/7.0.x/configuration/oauth_provider/index.html @@ -6,8 +6,8 @@ OAuth Provider Configuration | OAuth2 Proxy - - + + @@ -57,10 +57,10 @@ to setup the client id and client secret. Your "Redirection URI" will https://internalapp.yourcompany.com/oauth2/callback.

    -provider nextcloud
    -client-id <from nextcloud admin>
    -client-secret <from nextcloud admin>
    -login-url="<your nextcloud url>/index.php/apps/oauth2/authorize"
    -redeem-url="<your nextcloud url>/index.php/apps/oauth2/api/v1/token"
    -validate-url="<your nextcloud url>/ocs/v2.php/cloud/user?format=json"

    Note: in all cases the validate-url will not have the index.php.

    DigitalOcean Auth Provider

    1. Create a new OAuth application
      • You can fill in the name, homepage, and description however you wish.
      • In the "Application callback URL" field, enter: https://oauth-proxy/oauth2/callback, substituting oauth2-proxy with the actual hostname that oauth2-proxy is running on. The URL must match oauth2-proxy's configured redirect URL.
    2. Note the Client ID and Client Secret.

    To use the provider, pass the following options:

    --provider=digitalocean
    --client-id=<Client ID>
    --client-secret=<Client Secret>

    Alternatively, set the equivalent options in the config file. The redirect URL defaults to https://<requested host header>/oauth2/callback. If you need to change it, you can use the --redirect-url command-line option.

    Bitbucket Auth Provider

    1. Add a new OAuth consumer
      • In "Callback URL" use https://<oauth2-proxy>/oauth2/callback, substituting <oauth2-proxy> with the actual hostname that oauth2-proxy is running on.
      • In Permissions section select:
        • Account -> Email
        • Team membership -> Read
        • Repositories -> Read
    2. Note the Client ID and Client Secret.

    To use the provider, pass the following options:

    --provider=bitbucket
    --client-id=<Client ID>
    --client-secret=<Client Secret>

    The default configuration allows everyone with Bitbucket account to authenticate. To restrict the access to the team members use additional configuration option: --bitbucket-team=<Team name>. To restrict the access to only these users who has access to one selected repository use --bitbucket-repository=<Repository name>.

    Gitea Auth Provider

    1. Create a new application: https://< your gitea host >/user/settings/applications
    2. Under Redirect URI enter the correct URL i.e. https://<proxied host>/oauth2/callback
    3. Note the Client ID and Client Secret.
    4. Pass the following options to the proxy:
    --provider="github"
    --redirect-url="https://<proxied host>/oauth2/callback"
    --provider-display-name="Gitea"
    --client-id="< client_id as generated by Gitea >"
    --client-secret="< client_secret as generated by Gitea >"
    --login-url="https://< your gitea host >/login/oauth/authorize"
    --redeem-url="https://< your gitea host >/login/oauth/access_token"
    --validate-url="https://< your gitea host >/api/v1"

    Email Authentication

    To authorize by email domain use --email-domain=yourcompany.com. To authorize individual email addresses use --authenticated-emails-file=/path/to/file with one email per line. To authorize all email addresses use --email-domain=*.

    Adding a new Provider

    Follow the examples in the providers package to define a new Provider instance. Add a new case to providers.New() to allow oauth2-proxy to use the -new Provider.

    Copyright © 2021 OAuth2 Proxy.
    +new Provider.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.0.x/configuration/overview/index.html b/docs/7.0.x/configuration/overview/index.html index f128787f..cb2d014b 100644 --- a/docs/7.0.x/configuration/overview/index.html +++ b/docs/7.0.x/configuration/overview/index.html @@ -6,8 +6,8 @@ Overview | OAuth2 Proxy - - + + @@ -41,10 +41,10 @@ Note that nginxinc/kubernetes-ingress does not include the Lua modu
    services:
    a-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.2:7555
    oauth-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.1:4180
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    oauth-errors:
    errors:
    status:
    - "401-403"
    service: oauth-backend
    query: "/oauth2/sign_in"

    ForwardAuth with static upstreams configuration

    Redirect to sign_in functionality provided without the use of errors middleware with Traefik v2 ForwardAuth middleware pointing to oauth2-proxy service's / endpoint

    Following options need to be set on oauth2-proxy:

    • --upstream=static://202: Configures a static response for authenticated sessions
    • --reverseproxy=true: Enables the use of X-Forwarded-* headers to determine redirects correctly
    http:
    routers:
    a-service-route-1:
    rule: "Host(`a-service.example.com`, `b-service.example.com`) && PathPrefix(`/`)"
    service: a-service-backend
    middlewares:
    - oauth-auth-redirect # redirects all unauthenticated to oauth2 signin
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    a-service-route-2:
    rule: "Host(`a-service.example.com`) && PathPrefix(`/no-auto-redirect`)"
    service: a-service-backend
    middlewares:
    - oauth-auth-wo-redirect # unauthenticated session will return a 401
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    services-oauth2-route:
    rule: "Host(`a-service.example.com`, `b-service.example.com`) && PathPrefix(`/oauth2/`)"
    middlewares:
    - auth-headers
    service: oauth-backend
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    oauth2-proxy-route:
    rule: "Host(`oauth.example.com`) && PathPrefix(`/`)"
    middlewares:
    - auth-headers
    service: oauth-backend
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    services:
    a-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.2:7555
    b-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.3:7555
    oauth-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.1:4180
    -
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth-redirect:
    forwardAuth:
    address: https://oauth.example.com/
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    oauth-auth-wo-redirect:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    note

    If you set up your OAuth2 provider to rotate your client secret, you can use the client-secret-file option to reload the secret when it is updated.

    Copyright © 2021 OAuth2 Proxy.
    +
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth-redirect:
    forwardAuth:
    address: https://oauth.example.com/
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    oauth-auth-wo-redirect:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    note

    If you set up your OAuth2 provider to rotate your client secret, you can use the client-secret-file option to reload the secret when it is updated.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.0.x/configuration/session_storage/index.html b/docs/7.0.x/configuration/session_storage/index.html index f72f3467..4fa572f6 100644 --- a/docs/7.0.x/configuration/session_storage/index.html +++ b/docs/7.0.x/configuration/session_storage/index.html @@ -6,8 +6,8 @@ Session Storage | OAuth2 Proxy - - + + @@ -33,10 +33,10 @@ disclosure.

    Copyright © 2021 OAuth2 Proxy.
    +--redis-use-cluster=true flag, and configure the flags --redis-cluster-connection-urls appropriately.

    Note that flags --redis-use-sentinel=true and --redis-use-cluster=true are mutually exclusive.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.0.x/configuration/tls/index.html b/docs/7.0.x/configuration/tls/index.html index 4a72e452..1d085e57 100644 --- a/docs/7.0.x/configuration/tls/index.html +++ b/docs/7.0.x/configuration/tls/index.html @@ -6,8 +6,8 @@ TLS Configuration | OAuth2 Proxy - - + + @@ -24,10 +24,10 @@ external load balancer like Amazon ELB or Google Platform Load Balancing) use oauth2-proxy will then authenticate requests for an upstream application. The external endpoint for this example would be https://internal.yourcompany.com/.

    An example Nginx config follows. Note the use of Strict-Transport-Security header to pin requests to SSL via HSTS:

    server {
    listen 443 default ssl;
    server_name internal.yourcompany.com;
    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/cert.key;
    add_header Strict-Transport-Security max-age=2592000;
    -
    location / {
    proxy_pass http://127.0.0.1:4180;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_connect_timeout 1;
    proxy_send_timeout 30;
    proxy_read_timeout 30;
    }
    }

    The command line to run oauth2-proxy in this configuration would look like this:

    ./oauth2-proxy \
    --email-domain="yourcompany.com" \
    --upstream=http://127.0.0.1:8080/ \
    --cookie-secret=... \
    --cookie-secure=true \
    --provider=... \
    --reverse-proxy=true \
    --client-id=... \
    --client-secret=...
    Copyright © 2021 OAuth2 Proxy.
    +
    location / {
    proxy_pass http://127.0.0.1:4180;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_connect_timeout 1;
    proxy_send_timeout 30;
    proxy_read_timeout 30;
    }
    }

    The command line to run oauth2-proxy in this configuration would look like this:

    ./oauth2-proxy \
    --email-domain="yourcompany.com" \
    --upstream=http://127.0.0.1:8080/ \
    --cookie-secret=... \
    --cookie-secure=true \
    --provider=... \
    --reverse-proxy=true \
    --client-id=... \
    --client-secret=...
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.0.x/features/endpoints/index.html b/docs/7.0.x/features/endpoints/index.html index 0c981176..5b9f43bd 100644 --- a/docs/7.0.x/features/endpoints/index.html +++ b/docs/7.0.x/features/endpoints/index.html @@ -6,8 +6,8 @@ Endpoints | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: 7.0.x

    Endpoints

    OAuth2 Proxy responds directly to the following endpoints. All other endpoints will be proxied upstream when authenticated. The /oauth2 prefix can be changed with the --proxy-prefix config variable.

    • /robots.txt - returns a 200 OK response that disallows all User-agents from all paths; see robotstxt.org for more info
    • /ping - returns a 200 OK response, which is intended for use with health checks
    • /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
    • /oauth2/sign_out - this URL is used to clear the session cookie
    • /oauth2/start - a URL that will redirect to start the OAuth cycle
    • /oauth2/callback - the URL used at the end of the OAuth cycle. The oauth app will be configured with this as the callback url.
    • /oauth2/userinfo - the URL is used to return user's email from the session in JSON format.
    • /oauth2/auth - only returns a 202 Accepted response or a 401 Unauthorized response; for use with the Nginx auth_request directive

    Sign out

    To sign the user out, redirect them to /oauth2/sign_out. This endpoint only removes oauth2-proxy's own cookies, i.e. the user is still logged in with the authentication provider and may automatically re-login when accessing the application again. You will also need to redirect the user to the authentication provider's sign out page afterwards using the rd query parameter, i.e. redirect the user to something like (notice the url-encoding!):

    /oauth2/sign_out?rd=https%3A%2F%2Fmy-oidc-provider.example.com%2Fsign_out_page

    Alternatively, include the redirect URL in the X-Auth-Request-Redirect header:

    GET /oauth2/sign_out HTTP/1.1
    X-Auth-Request-Redirect: https://my-oidc-provider/sign_out_page
    ...

    (The "sign_out_page" should be the end_session_endpoint from the metadata if your OIDC provider supports Session Management and Discovery.)

    BEWARE that the domain you want to redirect to (my-oidc-provider.example.com in the example) must be added to the --whitelist-domain configuration option otherwise the redirect will be ignored.

    Copyright © 2021 OAuth2 Proxy.
    +
    Version: 7.0.x

    Endpoints

    OAuth2 Proxy responds directly to the following endpoints. All other endpoints will be proxied upstream when authenticated. The /oauth2 prefix can be changed with the --proxy-prefix config variable.

    • /robots.txt - returns a 200 OK response that disallows all User-agents from all paths; see robotstxt.org for more info
    • /ping - returns a 200 OK response, which is intended for use with health checks
    • /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
    • /oauth2/sign_out - this URL is used to clear the session cookie
    • /oauth2/start - a URL that will redirect to start the OAuth cycle
    • /oauth2/callback - the URL used at the end of the OAuth cycle. The oauth app will be configured with this as the callback url.
    • /oauth2/userinfo - the URL is used to return user's email from the session in JSON format.
    • /oauth2/auth - only returns a 202 Accepted response or a 401 Unauthorized response; for use with the Nginx auth_request directive

    Sign out

    To sign the user out, redirect them to /oauth2/sign_out. This endpoint only removes oauth2-proxy's own cookies, i.e. the user is still logged in with the authentication provider and may automatically re-login when accessing the application again. You will also need to redirect the user to the authentication provider's sign out page afterwards using the rd query parameter, i.e. redirect the user to something like (notice the url-encoding!):

    /oauth2/sign_out?rd=https%3A%2F%2Fmy-oidc-provider.example.com%2Fsign_out_page

    Alternatively, include the redirect URL in the X-Auth-Request-Redirect header:

    GET /oauth2/sign_out HTTP/1.1
    X-Auth-Request-Redirect: https://my-oidc-provider/sign_out_page
    ...

    (The "sign_out_page" should be the end_session_endpoint from the metadata if your OIDC provider supports Session Management and Discovery.)

    BEWARE that the domain you want to redirect to (my-oidc-provider.example.com in the example) must be added to the --whitelist-domain configuration option otherwise the redirect will be ignored.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.0.x/features/request_signatures/index.html b/docs/7.0.x/features/request_signatures/index.html index aa2eae97..d28a2387 100644 --- a/docs/7.0.x/features/request_signatures/index.html +++ b/docs/7.0.x/features/request_signatures/index.html @@ -6,8 +6,8 @@ Request Signatures | OAuth2 Proxy - - + + @@ -25,10 +25,10 @@ of selected request information and the request body Amazon Web Services: Signing and Authenticating REST Requests
  • rc3.org: Using HMAC to authenticate Web service -requests
  • Copyright © 2021 OAuth2 Proxy.
    +requests
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.0.x/index.html b/docs/7.0.x/index.html index 03e47a57..d0d0fdeb 100644 --- a/docs/7.0.x/index.html +++ b/docs/7.0.x/index.html @@ -6,8 +6,8 @@ Installation | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: 7.0.x

    Installation

    1. Choose how to deploy:

      a. Download Prebuilt Binary (current release is v7.0.1)

      b. Build with $ go get github.com/oauth2-proxy/oauth2-proxy/v7 which will put the binary in $GOPATH/bin

      c. Using the prebuilt docker image quay.io/oauth2-proxy/oauth2-proxy (AMD64, ARMv6 and ARM64 tags available)

    Prebuilt binaries can be validated by extracting the file and verifying it against the sha256sum.txt checksum file provided for each release starting with version v3.0.0.

    $ sha256sum -c sha256sum.txt 2>&1 | grep OK
    oauth2-proxy-x.y.z.linux-amd64: OK
    1. Select a Provider and Register an OAuth Application with a Provider
    2. Configure OAuth2 Proxy using config file, command line options, or environment variables
    3. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
    Copyright © 2021 OAuth2 Proxy.
    +
    Version: 7.0.x

    Installation

    1. Choose how to deploy:

      a. Download Prebuilt Binary (current release is v7.0.1)

      b. Build with $ go get github.com/oauth2-proxy/oauth2-proxy/v7 which will put the binary in $GOPATH/bin

      c. Using the prebuilt docker image quay.io/oauth2-proxy/oauth2-proxy (AMD64, ARMv6 and ARM64 tags available)

    Prebuilt binaries can be validated by extracting the file and verifying it against the sha256sum.txt checksum file provided for each release starting with version v3.0.0.

    $ sha256sum -c sha256sum.txt 2>&1 | grep OK
    oauth2-proxy-x.y.z.linux-amd64: OK
    1. Select a Provider and Register an OAuth Application with a Provider
    2. Configure OAuth2 Proxy using config file, command line options, or environment variables
    3. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.1.x/behaviour/index.html b/docs/7.1.x/behaviour/index.html index 56c4774c..ac0786a9 100644 --- a/docs/7.1.x/behaviour/index.html +++ b/docs/7.1.x/behaviour/index.html @@ -6,8 +6,8 @@ Behaviour | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: 7.1.x

    Behaviour

    1. Any request passing through the proxy (and not matched by --skip-auth-regex) is checked for the proxy's session cookie (--cookie-name) (or, if allowed, a JWT token - see --skip-jwt-bearer-tokens).
    2. If authentication is required but missing then the user is asked to log in and redirected to the authentication provider (unless it is an Ajax request, i.e. one with Accept: application/json, in which case 401 Unauthorized is returned)
    3. After returning from the authentication provider, the oauth tokens are stored in the configured session store (cookie, redis, ...) and a cookie is set
    4. The request is forwarded to the upstream server with added user info and authentication headers (depending on the configuration)

    Notice that the proxy also provides a number of useful endpoints.

    Copyright © 2021 OAuth2 Proxy.
    +
    Version: 7.1.x

    Behaviour

    1. Any request passing through the proxy (and not matched by --skip-auth-regex) is checked for the proxy's session cookie (--cookie-name) (or, if allowed, a JWT token - see --skip-jwt-bearer-tokens).
    2. If authentication is required but missing then the user is asked to log in and redirected to the authentication provider (unless it is an Ajax request, i.e. one with Accept: application/json, in which case 401 Unauthorized is returned)
    3. After returning from the authentication provider, the oauth tokens are stored in the configured session store (cookie, redis, ...) and a cookie is set
    4. The request is forwarded to the upstream server with added user info and authentication headers (depending on the configuration)

    Notice that the proxy also provides a number of useful endpoints.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.1.x/community/security/index.html b/docs/7.1.x/community/security/index.html index 471f9b81..8ed63ca4 100644 --- a/docs/7.1.x/community/security/index.html +++ b/docs/7.1.x/community/security/index.html @@ -6,8 +6,8 @@ Security | OAuth2 Proxy - - + + @@ -36,10 +36,10 @@ dependencies), we may use regular PRs for fixes and forego the security advisory If we have multiple security issues in flight simultaneously, we may delay merging fixes until all patches are ready. We may also backport the fix to previous releases, -but this will be at the discretion of the maintainers.

    Copyright © 2021 OAuth2 Proxy.
    +but this will be at the discretion of the maintainers.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.1.x/configuration/alpha-config/index.html b/docs/7.1.x/configuration/alpha-config/index.html index 68e44c46..8e830aae 100644 --- a/docs/7.1.x/configuration/alpha-config/index.html +++ b/docs/7.1.x/configuration/alpha-config/index.html @@ -6,8 +6,8 @@ Alpha Configuration | OAuth2 Proxy - - + + @@ -42,10 +42,10 @@ Valid time units are "ns", "us" (or "µs"), " response header.

    FieldTypeDescription
    namestringName is the header name to be used for this set of values.
    Names should be unique within a list of Headers.
    preserveRequestValueboolPreserveRequestValue determines whether any values for this header
    should be preserved for the request to the upstream server.
    This option only applies to injected request headers.
    Defaults to false (headers that match this header will be stripped).
    values[]HeaderValueValues contains the desired values for this header

    HeaderValue

    (Appears on: Header)

    HeaderValue represents a single header value and the sources that can make up the header value

    FieldTypeDescription
    value[]byteValue expects a base64 encoded string value.
    fromEnvstringFromEnv expects the name of an environment variable.
    fromFilestringFromFile expects a path to a file containing the secret value.
    claimstringClaim is the name of the claim in the session that the value should be
    loaded from.
    prefixstringPrefix is an optional prefix that will be prepended to the value of the
    claim if it is non-empty.
    basicAuthPasswordSecretSourceBasicAuthPassword converts this claim into a basic auth header.
    Note the value of claim will become the basic auth username and the
    basicAuthPassword will be used as the password value.

    SecretSource

    (Appears on: ClaimSource, HeaderValue, TLS)

    SecretSource references an individual secret value. Only one source within the struct should be defined at any time.

    FieldTypeDescription
    value[]byteValue expects a base64 encoded string value.
    fromEnvstringFromEnv expects the name of an environment variable.
    fromFilestringFromFile expects a path to a file containing the secret value.

    Server

    (Appears on: AlphaOptions)

    Server represents the configuration for an HTTP(S) server

    FieldTypeDescription
    BindAddressstringBindAddress is the address on which to serve traffic.
    Leave blank or set to "-" to disable.
    SecureBindAddressstringSecureBindAddress is the address on which to serve secure traffic.
    Leave blank or set to "-" to disable.
    TLSTLSTLS contains the information for loading the certificate and key for the
    secure traffic.

    TLS

    (Appears on: Server)

    TLS contains the information for loading a TLS certifcate and key.

    FieldTypeDescription
    KeySecretSourceKey is the TLS key data to use.
    Typically this will come from a file.
    CertSecretSourceCert is the TLS certificate data to use.
    Typically this will come from a file.

    Upstream

    (Appears on: Upstreams)

    Upstream represents the configuration for an upstream server. -Requests will be proxied to this upstream if the path matches the request path.

    FieldTypeDescription
    idstringID should be a unique identifier for the upstream.
    This value is required for all upstreams.
    pathstringPath is used to map requests to the upstream server.
    The closest match will take precedence and all Paths must be unique.
    uristringThe URI of the upstream server. This may be an HTTP(S) server of a File
    based URL. It may include a path, in which case all requests will be served
    under that path.
    Eg:
    - http://localhost:8080
    - https://service.localhost
    - https://service.localhost/path
    - file://host/path
    If the URI's path is "/base" and the incoming request was for "/dir",
    the upstream request will be for "/base/dir".
    insecureSkipTLSVerifyboolInsecureSkipTLSVerify will skip TLS verification of upstream HTTPS hosts.
    This option is insecure and will allow potential Man-In-The-Middle attacks
    betweem OAuth2 Proxy and the usptream server.
    Defaults to false.
    staticboolStatic will make all requests to this upstream have a static response.
    The response will have a body of "Authenticated" and a response code
    matching StaticCode.
    If StaticCode is not set, the response will return a 200 response.
    staticCodeintStaticCode determines the response code for the Static response.
    This option can only be used with Static enabled.
    flushIntervalDurationFlushInterval is the period between flushing the response buffer when
    streaming response from the upstream.
    Defaults to 1 second.
    passHostHeaderboolPassHostHeader determines whether the request host header should be proxied
    to the upstream server.
    Defaults to true.
    proxyWebSocketsboolProxyWebSockets enables proxying of websockets to upstream servers
    Defaults to true.

    Upstreams

    ([]Upstream alias)

    (Appears on: AlphaOptions)

    Upstreams is a collection of definitions for upstream servers.

    Copyright © 2021 OAuth2 Proxy.
    +Requests will be proxied to this upstream if the path matches the request path.

    FieldTypeDescription
    idstringID should be a unique identifier for the upstream.
    This value is required for all upstreams.
    pathstringPath is used to map requests to the upstream server.
    The closest match will take precedence and all Paths must be unique.
    uristringThe URI of the upstream server. This may be an HTTP(S) server of a File
    based URL. It may include a path, in which case all requests will be served
    under that path.
    Eg:
    - http://localhost:8080
    - https://service.localhost
    - https://service.localhost/path
    - file://host/path
    If the URI's path is "/base" and the incoming request was for "/dir",
    the upstream request will be for "/base/dir".
    insecureSkipTLSVerifyboolInsecureSkipTLSVerify will skip TLS verification of upstream HTTPS hosts.
    This option is insecure and will allow potential Man-In-The-Middle attacks
    betweem OAuth2 Proxy and the usptream server.
    Defaults to false.
    staticboolStatic will make all requests to this upstream have a static response.
    The response will have a body of "Authenticated" and a response code
    matching StaticCode.
    If StaticCode is not set, the response will return a 200 response.
    staticCodeintStaticCode determines the response code for the Static response.
    This option can only be used with Static enabled.
    flushIntervalDurationFlushInterval is the period between flushing the response buffer when
    streaming response from the upstream.
    Defaults to 1 second.
    passHostHeaderboolPassHostHeader determines whether the request host header should be proxied
    to the upstream server.
    Defaults to true.
    proxyWebSocketsboolProxyWebSockets enables proxying of websockets to upstream servers
    Defaults to true.

    Upstreams

    ([]Upstream alias)

    (Appears on: AlphaOptions)

    Upstreams is a collection of definitions for upstream servers.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.1.x/configuration/oauth_provider/index.html b/docs/7.1.x/configuration/oauth_provider/index.html index 7b386fe9..119ac7a6 100644 --- a/docs/7.1.x/configuration/oauth_provider/index.html +++ b/docs/7.1.x/configuration/oauth_provider/index.html @@ -6,8 +6,8 @@ OAuth Provider Configuration | OAuth2 Proxy - - + + @@ -57,10 +57,10 @@ to setup the client id and client secret. Your "Redirection URI" will https://internalapp.yourcompany.com/oauth2/callback.

    -provider nextcloud
    -client-id <from nextcloud admin>
    -client-secret <from nextcloud admin>
    -login-url="<your nextcloud url>/index.php/apps/oauth2/authorize"
    -redeem-url="<your nextcloud url>/index.php/apps/oauth2/api/v1/token"
    -validate-url="<your nextcloud url>/ocs/v2.php/cloud/user?format=json"

    Note: in all cases the validate-url will not have the index.php.

    DigitalOcean Auth Provider

    1. Create a new OAuth application
      • You can fill in the name, homepage, and description however you wish.
      • In the "Application callback URL" field, enter: https://oauth-proxy/oauth2/callback, substituting oauth2-proxy with the actual hostname that oauth2-proxy is running on. The URL must match oauth2-proxy's configured redirect URL.
    2. Note the Client ID and Client Secret.

    To use the provider, pass the following options:

    --provider=digitalocean
    --client-id=<Client ID>
    --client-secret=<Client Secret>

    Alternatively, set the equivalent options in the config file. The redirect URL defaults to https://<requested host header>/oauth2/callback. If you need to change it, you can use the --redirect-url command-line option.

    Bitbucket Auth Provider

    1. Add a new OAuth consumer
      • In "Callback URL" use https://<oauth2-proxy>/oauth2/callback, substituting <oauth2-proxy> with the actual hostname that oauth2-proxy is running on.
      • In Permissions section select:
        • Account -> Email
        • Team membership -> Read
        • Repositories -> Read
    2. Note the Client ID and Client Secret.

    To use the provider, pass the following options:

    --provider=bitbucket
    --client-id=<Client ID>
    --client-secret=<Client Secret>

    The default configuration allows everyone with Bitbucket account to authenticate. To restrict the access to the team members use additional configuration option: --bitbucket-team=<Team name>. To restrict the access to only these users who has access to one selected repository use --bitbucket-repository=<Repository name>.

    Gitea Auth Provider

    1. Create a new application: https://< your gitea host >/user/settings/applications
    2. Under Redirect URI enter the correct URL i.e. https://<proxied host>/oauth2/callback
    3. Note the Client ID and Client Secret.
    4. Pass the following options to the proxy:
    --provider="github"
    --redirect-url="https://<proxied host>/oauth2/callback"
    --provider-display-name="Gitea"
    --client-id="< client_id as generated by Gitea >"
    --client-secret="< client_secret as generated by Gitea >"
    --login-url="https://< your gitea host >/login/oauth/authorize"
    --redeem-url="https://< your gitea host >/login/oauth/access_token"
    --validate-url="https://< your gitea host >/api/v1"

    Email Authentication

    To authorize by email domain use --email-domain=yourcompany.com. To authorize individual email addresses use --authenticated-emails-file=/path/to/file with one email per line. To authorize all email addresses use --email-domain=*.

    Adding a new Provider

    Follow the examples in the providers package to define a new Provider instance. Add a new case to providers.New() to allow oauth2-proxy to use the -new Provider.

    Copyright © 2021 OAuth2 Proxy.
    +new Provider.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.1.x/configuration/overview/index.html b/docs/7.1.x/configuration/overview/index.html index dd65cade..7556bb99 100644 --- a/docs/7.1.x/configuration/overview/index.html +++ b/docs/7.1.x/configuration/overview/index.html @@ -6,8 +6,8 @@ Overview | OAuth2 Proxy - - + + @@ -41,10 +41,10 @@ Note that nginxinc/kubernetes-ingress does not include the Lua modu
    services:
    a-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.2:7555
    oauth-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.1:4180
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    oauth-errors:
    errors:
    status:
    - "401-403"
    service: oauth-backend
    query: "/oauth2/sign_in"

    ForwardAuth with static upstreams configuration

    Redirect to sign_in functionality provided without the use of errors middleware with Traefik v2 ForwardAuth middleware pointing to oauth2-proxy service's / endpoint

    Following options need to be set on oauth2-proxy:

    • --upstream=static://202: Configures a static response for authenticated sessions
    • --reverseproxy=true: Enables the use of X-Forwarded-* headers to determine redirects correctly
    http:
    routers:
    a-service-route-1:
    rule: "Host(`a-service.example.com`, `b-service.example.com`) && PathPrefix(`/`)"
    service: a-service-backend
    middlewares:
    - oauth-auth-redirect # redirects all unauthenticated to oauth2 signin
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    a-service-route-2:
    rule: "Host(`a-service.example.com`) && PathPrefix(`/no-auto-redirect`)"
    service: a-service-backend
    middlewares:
    - oauth-auth-wo-redirect # unauthenticated session will return a 401
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    services-oauth2-route:
    rule: "Host(`a-service.example.com`, `b-service.example.com`) && PathPrefix(`/oauth2/`)"
    middlewares:
    - auth-headers
    service: oauth-backend
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    oauth2-proxy-route:
    rule: "Host(`oauth.example.com`) && PathPrefix(`/`)"
    middlewares:
    - auth-headers
    service: oauth-backend
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    services:
    a-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.2:7555
    b-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.3:7555
    oauth-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.1:4180
    -
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth-redirect:
    forwardAuth:
    address: https://oauth.example.com/
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    oauth-auth-wo-redirect:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    note

    If you set up your OAuth2 provider to rotate your client secret, you can use the client-secret-file option to reload the secret when it is updated.

    Copyright © 2021 OAuth2 Proxy.
    +
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth-redirect:
    forwardAuth:
    address: https://oauth.example.com/
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    oauth-auth-wo-redirect:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    note

    If you set up your OAuth2 provider to rotate your client secret, you can use the client-secret-file option to reload the secret when it is updated.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.1.x/configuration/session_storage/index.html b/docs/7.1.x/configuration/session_storage/index.html index a800225f..ea94483e 100644 --- a/docs/7.1.x/configuration/session_storage/index.html +++ b/docs/7.1.x/configuration/session_storage/index.html @@ -6,8 +6,8 @@ Session Storage | OAuth2 Proxy - - + + @@ -33,10 +33,10 @@ disclosure.

    Copyright © 2021 OAuth2 Proxy.
    +--redis-use-cluster=true flag, and configure the flags --redis-cluster-connection-urls appropriately.

    Note that flags --redis-use-sentinel=true and --redis-use-cluster=true are mutually exclusive.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.1.x/configuration/tls/index.html b/docs/7.1.x/configuration/tls/index.html index 78eeb8b7..e3d919af 100644 --- a/docs/7.1.x/configuration/tls/index.html +++ b/docs/7.1.x/configuration/tls/index.html @@ -6,8 +6,8 @@ TLS Configuration | OAuth2 Proxy - - + + @@ -24,10 +24,10 @@ external load balancer like Amazon ELB or Google Platform Load Balancing) use oauth2-proxy will then authenticate requests for an upstream application. The external endpoint for this example would be https://internal.yourcompany.com/.

    An example Nginx config follows. Note the use of Strict-Transport-Security header to pin requests to SSL via HSTS:

    server {
    listen 443 default ssl;
    server_name internal.yourcompany.com;
    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/cert.key;
    add_header Strict-Transport-Security max-age=2592000;
    -
    location / {
    proxy_pass http://127.0.0.1:4180;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_connect_timeout 1;
    proxy_send_timeout 30;
    proxy_read_timeout 30;
    }
    }

    The command line to run oauth2-proxy in this configuration would look like this:

    ./oauth2-proxy \
    --email-domain="yourcompany.com" \
    --upstream=http://127.0.0.1:8080/ \
    --cookie-secret=... \
    --cookie-secure=true \
    --provider=... \
    --reverse-proxy=true \
    --client-id=... \
    --client-secret=...
    Copyright © 2021 OAuth2 Proxy.
    +
    location / {
    proxy_pass http://127.0.0.1:4180;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_connect_timeout 1;
    proxy_send_timeout 30;
    proxy_read_timeout 30;
    }
    }

    The command line to run oauth2-proxy in this configuration would look like this:

    ./oauth2-proxy \
    --email-domain="yourcompany.com" \
    --upstream=http://127.0.0.1:8080/ \
    --cookie-secret=... \
    --cookie-secure=true \
    --provider=... \
    --reverse-proxy=true \
    --client-id=... \
    --client-secret=...
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.1.x/features/endpoints/index.html b/docs/7.1.x/features/endpoints/index.html index 6e71aed4..6ea30459 100644 --- a/docs/7.1.x/features/endpoints/index.html +++ b/docs/7.1.x/features/endpoints/index.html @@ -6,8 +6,8 @@ Endpoints | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: 7.1.x

    Endpoints

    OAuth2 Proxy responds directly to the following endpoints. All other endpoints will be proxied upstream when authenticated. The /oauth2 prefix can be changed with the --proxy-prefix config variable.

    • /robots.txt - returns a 200 OK response that disallows all User-agents from all paths; see robotstxt.org for more info
    • /ping - returns a 200 OK response, which is intended for use with health checks
    • /metrics - Metrics endpoint for Prometheus to scrape, serve on the address specified by --metrics-address, disabled by default
    • /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
    • /oauth2/sign_out - this URL is used to clear the session cookie
    • /oauth2/start - a URL that will redirect to start the OAuth cycle
    • /oauth2/callback - the URL used at the end of the OAuth cycle. The oauth app will be configured with this as the callback url.
    • /oauth2/userinfo - the URL is used to return user's email from the session in JSON format.
    • /oauth2/auth - only returns a 202 Accepted response or a 401 Unauthorized response; for use with the Nginx auth_request directive

    Sign out

    To sign the user out, redirect them to /oauth2/sign_out. This endpoint only removes oauth2-proxy's own cookies, i.e. the user is still logged in with the authentication provider and may automatically re-login when accessing the application again. You will also need to redirect the user to the authentication provider's sign out page afterwards using the rd query parameter, i.e. redirect the user to something like (notice the url-encoding!):

    /oauth2/sign_out?rd=https%3A%2F%2Fmy-oidc-provider.example.com%2Fsign_out_page

    Alternatively, include the redirect URL in the X-Auth-Request-Redirect header:

    GET /oauth2/sign_out HTTP/1.1
    X-Auth-Request-Redirect: https://my-oidc-provider/sign_out_page
    ...

    (The "sign_out_page" should be the end_session_endpoint from the metadata if your OIDC provider supports Session Management and Discovery.)

    BEWARE that the domain you want to redirect to (my-oidc-provider.example.com in the example) must be added to the --whitelist-domain configuration option otherwise the redirect will be ignored.

    Copyright © 2021 OAuth2 Proxy.
    +
    Version: 7.1.x

    Endpoints

    OAuth2 Proxy responds directly to the following endpoints. All other endpoints will be proxied upstream when authenticated. The /oauth2 prefix can be changed with the --proxy-prefix config variable.

    • /robots.txt - returns a 200 OK response that disallows all User-agents from all paths; see robotstxt.org for more info
    • /ping - returns a 200 OK response, which is intended for use with health checks
    • /metrics - Metrics endpoint for Prometheus to scrape, serve on the address specified by --metrics-address, disabled by default
    • /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
    • /oauth2/sign_out - this URL is used to clear the session cookie
    • /oauth2/start - a URL that will redirect to start the OAuth cycle
    • /oauth2/callback - the URL used at the end of the OAuth cycle. The oauth app will be configured with this as the callback url.
    • /oauth2/userinfo - the URL is used to return user's email from the session in JSON format.
    • /oauth2/auth - only returns a 202 Accepted response or a 401 Unauthorized response; for use with the Nginx auth_request directive

    Sign out

    To sign the user out, redirect them to /oauth2/sign_out. This endpoint only removes oauth2-proxy's own cookies, i.e. the user is still logged in with the authentication provider and may automatically re-login when accessing the application again. You will also need to redirect the user to the authentication provider's sign out page afterwards using the rd query parameter, i.e. redirect the user to something like (notice the url-encoding!):

    /oauth2/sign_out?rd=https%3A%2F%2Fmy-oidc-provider.example.com%2Fsign_out_page

    Alternatively, include the redirect URL in the X-Auth-Request-Redirect header:

    GET /oauth2/sign_out HTTP/1.1
    X-Auth-Request-Redirect: https://my-oidc-provider/sign_out_page
    ...

    (The "sign_out_page" should be the end_session_endpoint from the metadata if your OIDC provider supports Session Management and Discovery.)

    BEWARE that the domain you want to redirect to (my-oidc-provider.example.com in the example) must be added to the --whitelist-domain configuration option otherwise the redirect will be ignored.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/7.1.x/index.html b/docs/7.1.x/index.html index 67fdc1c7..f3c6c969 100644 --- a/docs/7.1.x/index.html +++ b/docs/7.1.x/index.html @@ -6,8 +6,8 @@ Installation | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: 7.1.x

    Installation

    1. Choose how to deploy:

      a. Download Prebuilt Binary (current release is v7.1.3)

      b. Build with $ go get github.com/oauth2-proxy/oauth2-proxy/v7 which will put the binary in $GOPATH/bin

      c. Using the prebuilt docker image quay.io/oauth2-proxy/oauth2-proxy (AMD64, ARMv6 and ARM64 tags available)

      d. Using a Kubernetes manifest (Helm)

    Prebuilt binaries can be validated by extracting the file and verifying it against the sha256sum.txt checksum file provided for each release starting with version v3.0.0.

    $ sha256sum -c sha256sum.txt 2>&1 | grep OK
    oauth2-proxy-x.y.z.linux-amd64: OK
    1. Select a Provider and Register an OAuth Application with a Provider
    2. Configure OAuth2 Proxy using config file, command line options, or environment variables
    3. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
    Copyright © 2021 OAuth2 Proxy.
    +
    Version: 7.1.x

    Installation

    1. Choose how to deploy:

      a. Download Prebuilt Binary (current release is v7.1.3)

      b. Build with $ go get github.com/oauth2-proxy/oauth2-proxy/v7 which will put the binary in $GOPATH/bin

      c. Using the prebuilt docker image quay.io/oauth2-proxy/oauth2-proxy (AMD64, ARMv6 and ARM64 tags available)

      d. Using a Kubernetes manifest (Helm)

    Prebuilt binaries can be validated by extracting the file and verifying it against the sha256sum.txt checksum file provided for each release starting with version v3.0.0.

    $ sha256sum -c sha256sum.txt 2>&1 | grep OK
    oauth2-proxy-x.y.z.linux-amd64: OK
    1. Select a Provider and Register an OAuth Application with a Provider
    2. Configure OAuth2 Proxy using config file, command line options, or environment variables
    3. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/behaviour/index.html b/docs/behaviour/index.html index 05125061..289758e8 100644 --- a/docs/behaviour/index.html +++ b/docs/behaviour/index.html @@ -6,8 +6,8 @@ Behaviour | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: 7.2.x

    Behaviour

    1. Any request passing through the proxy (and not matched by --skip-auth-regex) is checked for the proxy's session cookie (--cookie-name) (or, if allowed, a JWT token - see --skip-jwt-bearer-tokens).
    2. If authentication is required but missing then the user is asked to log in and redirected to the authentication provider (unless it is an Ajax request, i.e. one with Accept: application/json, in which case 401 Unauthorized is returned)
    3. After returning from the authentication provider, the oauth tokens are stored in the configured session store (cookie, redis, ...) and a cookie is set
    4. The request is forwarded to the upstream server with added user info and authentication headers (depending on the configuration)

    Notice that the proxy also provides a number of useful endpoints.

    Copyright © 2021 OAuth2 Proxy.
    +
    Version: 7.2.x

    Behaviour

    1. Any request passing through the proxy (and not matched by --skip-auth-regex) is checked for the proxy's session cookie (--cookie-name) (or, if allowed, a JWT token - see --skip-jwt-bearer-tokens).
    2. If authentication is required but missing then the user is asked to log in and redirected to the authentication provider (unless it is an Ajax request, i.e. one with Accept: application/json, in which case 401 Unauthorized is returned)
    3. After returning from the authentication provider, the oauth tokens are stored in the configured session store (cookie, redis, ...) and a cookie is set
    4. The request is forwarded to the upstream server with added user info and authentication headers (depending on the configuration)

    Notice that the proxy also provides a number of useful endpoints.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/community/security/index.html b/docs/community/security/index.html index d6264920..22b03f30 100644 --- a/docs/community/security/index.html +++ b/docs/community/security/index.html @@ -6,8 +6,8 @@ Security | OAuth2 Proxy - - + + @@ -36,10 +36,10 @@ dependencies), we may use regular PRs for fixes and forego the security advisory If we have multiple security issues in flight simultaneously, we may delay merging fixes until all patches are ready. We may also backport the fix to previous releases, -but this will be at the discretion of the maintainers.

    Copyright © 2021 OAuth2 Proxy.
    +but this will be at the discretion of the maintainers.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/configuration/alpha-config/index.html b/docs/configuration/alpha-config/index.html index b6d2a240..4c0d72c7 100644 --- a/docs/configuration/alpha-config/index.html +++ b/docs/configuration/alpha-config/index.html @@ -6,8 +6,8 @@ Alpha Configuration | OAuth2 Proxy - - + + @@ -42,10 +42,10 @@ Valid time units are "ns", "us" (or "µs"), " response header.

    FieldTypeDescription
    namestringName is the header name to be used for this set of values.
    Names should be unique within a list of Headers.
    preserveRequestValueboolPreserveRequestValue determines whether any values for this header
    should be preserved for the request to the upstream server.
    This option only applies to injected request headers.
    Defaults to false (headers that match this header will be stripped).
    values[]HeaderValueValues contains the desired values for this header

    HeaderValue

    (Appears on: Header)

    HeaderValue represents a single header value and the sources that can make up the header value

    FieldTypeDescription
    value[]byteValue expects a base64 encoded string value.
    fromEnvstringFromEnv expects the name of an environment variable.
    fromFilestringFromFile expects a path to a file containing the secret value.
    claimstringClaim is the name of the claim in the session that the value should be
    loaded from.
    prefixstringPrefix is an optional prefix that will be prepended to the value of the
    claim if it is non-empty.
    basicAuthPasswordSecretSourceBasicAuthPassword converts this claim into a basic auth header.
    Note the value of claim will become the basic auth username and the
    basicAuthPassword will be used as the password value.

    KeycloakOptions

    (Appears on: Provider)

    FieldTypeDescription
    groups[]stringGroup enables to restrict login to members of indicated group
    roles[]stringRole enables to restrict login to users with role (only available when using the keycloak-oidc provider)

    LoginGovOptions

    (Appears on: Provider)

    FieldTypeDescription
    jwtKeystringJWTKey is a private key in PEM format used to sign JWT,
    jwtKeyFilestringJWTKeyFile is a path to the private key file in PEM format used to sign the JWT
    pubjwkURLstringPubJWKURL is the JWK pubkey access endpoint

    OIDCOptions

    (Appears on: Provider)

    FieldTypeDescription
    issuerURLstringIssuerURL is the OpenID Connect issuer URL
    eg: https://accounts.google.com
    insecureAllowUnverifiedEmailboolInsecureAllowUnverifiedEmail prevents failures if an email address in an id_token is not verified
    default set to 'false'
    insecureSkipIssuerVerificationboolInsecureSkipIssuerVerification skips verification of ID token issuers. When false, ID Token Issuers must match the OIDC discovery URL
    default set to 'false'
    insecureSkipNonceboolInsecureSkipNonce skips verifying the ID Token's nonce claim that must match
    the random nonce sent in the initial OAuth flow. Otherwise, the nonce is checked
    after the initial OAuth redeem & subsequent token refreshes.
    default set to 'true'
    Warning: In a future release, this will change to 'false' by default for enhanced security.
    skipDiscoveryboolSkipDiscovery allows to skip OIDC discovery and use manually supplied Endpoints
    default set to 'false'
    jwksURLstringJwksURL is the OpenID Connect JWKS URL
    eg: https://www.googleapis.com/oauth2/v3/certs
    emailClaimstringEmailClaim indicates which claim contains the user email,
    default set to 'email'
    groupsClaimstringGroupsClaim indicates which claim contains the user groups
    default set to 'groups'
    userIDClaimstringUserIDClaim indicates which claim contains the user ID
    default set to 'email'

    Provider

    (Appears on: Providers)

    Provider holds all configuration for a single provider

    FieldTypeDescription
    clientIDstringClientID is the OAuth Client ID that is defined in the provider
    This value is required for all providers.
    clientSecretstringClientSecret is the OAuth Client Secret that is defined in the provider
    This value is required for all providers.
    clientSecretFilestringClientSecretFile is the name of the file
    containing the OAuth Client Secret, it will be used if ClientSecret is not set.
    keycloakConfigKeycloakOptionsKeycloakConfig holds all configurations for Keycloak provider.
    azureConfigAzureOptionsAzureConfig holds all configurations for Azure provider.
    ADFSConfigADFSOptionsADFSConfig holds all configurations for ADFS provider.
    bitbucketConfigBitbucketOptionsBitbucketConfig holds all configurations for Bitbucket provider.
    githubConfigGitHubOptionsGitHubConfig holds all configurations for GitHubC provider.
    gitlabConfigGitLabOptionsGitLabConfig holds all configurations for GitLab provider.
    googleConfigGoogleOptionsGoogleConfig holds all configurations for Google provider.
    oidcConfigOIDCOptionsOIDCConfig holds all configurations for OIDC provider
    or providers utilize OIDC configurations.
    loginGovConfigLoginGovOptionsLoginGovConfig holds all configurations for LoginGov provider.
    idstringID should be a unique identifier for the provider.
    This value is required for all providers.
    providerstringType is the OAuth provider
    must be set from the supported providers group,
    otherwise 'Google' is set as default
    namestringName is the providers display name
    if set, it will be shown to the users in the login page.
    caFiles[]stringCAFiles is a list of paths to CA certificates that should be used when connecting to the provider.
    If not specified, the default Go trust sources are used instead
    loginURLstringLoginURL is the authentication endpoint
    redeemURLstringRedeemURL is the token redemption endpoint
    profileURLstringProfileURL is the profile access endpoint
    resourcestringProtectedResource is the resource that is protected (Azure AD and ADFS only)
    validateURLstringValidateURL is the access token validation endpoint
    scopestringScope is the OAuth scope specification
    promptstringPrompt is OIDC prompt
    approvalPromptstringApprovalPrompt is the OAuth approval_prompt
    default is set to 'force'
    allowedGroups[]stringAllowedGroups is a list of restrict logins to members of this group
    acrValuesstringAcrValues is a string of acr values

    Providers

    ([]Provider alias)

    (Appears on: AlphaOptions)

    Providers is a collection of definitions for providers.

    SecretSource

    (Appears on: ClaimSource, HeaderValue, TLS)

    SecretSource references an individual secret value. Only one source within the struct should be defined at any time.

    FieldTypeDescription
    value[]byteValue expects a base64 encoded string value.
    fromEnvstringFromEnv expects the name of an environment variable.
    fromFilestringFromFile expects a path to a file containing the secret value.

    Server

    (Appears on: AlphaOptions)

    Server represents the configuration for an HTTP(S) server

    FieldTypeDescription
    BindAddressstringBindAddress is the address on which to serve traffic.
    Leave blank or set to "-" to disable.
    SecureBindAddressstringSecureBindAddress is the address on which to serve secure traffic.
    Leave blank or set to "-" to disable.
    TLSTLSTLS contains the information for loading the certificate and key for the
    secure traffic.

    TLS

    (Appears on: Server)

    TLS contains the information for loading a TLS certifcate and key.

    FieldTypeDescription
    KeySecretSourceKey is the TLS key data to use.
    Typically this will come from a file.
    CertSecretSourceCert is the TLS certificate data to use.
    Typically this will come from a file.

    Upstream

    (Appears on: UpstreamConfig)

    Upstream represents the configuration for an upstream server. -Requests will be proxied to this upstream if the path matches the request path.

    FieldTypeDescription
    idstringID should be a unique identifier for the upstream.
    This value is required for all upstreams.
    pathstringPath is used to map requests to the upstream server.
    The closest match will take precedence and all Paths must be unique.
    Path can also take a pattern when used with RewriteTarget.
    Path segments can be captured and matched using regular experessions.
    Eg:
    - ^/foo$: Match only the explicit path /foo
    - ^/bar/$: Match any path prefixed with /bar/
    - ^/baz/(.*)$: Match any path prefixed with /baz and capture the remaining path for use with RewriteTarget
    rewriteTargetstringRewriteTarget allows users to rewrite the request path before it is sent to
    the upstream server.
    Use the Path to capture segments for reuse within the rewrite target.
    Eg: With a Path of ^/baz/(.*), a RewriteTarget of /foo/$1 would rewrite
    the request /baz/abc/123 to /foo/abc/123 before proxying to the
    upstream server.
    uristringThe URI of the upstream server. This may be an HTTP(S) server of a File
    based URL. It may include a path, in which case all requests will be served
    under that path.
    Eg:
    - http://localhost:8080
    - https://service.localhost
    - https://service.localhost/path
    - file://host/path
    If the URI's path is "/base" and the incoming request was for "/dir",
    the upstream request will be for "/base/dir".
    insecureSkipTLSVerifyboolInsecureSkipTLSVerify will skip TLS verification of upstream HTTPS hosts.
    This option is insecure and will allow potential Man-In-The-Middle attacks
    betweem OAuth2 Proxy and the usptream server.
    Defaults to false.
    staticboolStatic will make all requests to this upstream have a static response.
    The response will have a body of "Authenticated" and a response code
    matching StaticCode.
    If StaticCode is not set, the response will return a 200 response.
    staticCodeintStaticCode determines the response code for the Static response.
    This option can only be used with Static enabled.
    flushIntervalDurationFlushInterval is the period between flushing the response buffer when
    streaming response from the upstream.
    Defaults to 1 second.
    passHostHeaderboolPassHostHeader determines whether the request host header should be proxied
    to the upstream server.
    Defaults to true.
    proxyWebSocketsboolProxyWebSockets enables proxying of websockets to upstream servers
    Defaults to true.

    UpstreamConfig

    (Appears on: AlphaOptions)

    UpstreamConfig is a collection of definitions for upstream servers.

    FieldTypeDescription
    proxyRawPathboolProxyRawPath will pass the raw url path to upstream allowing for url's
    like: "/%2F/" which would otherwise be redirected to "/"
    upstreams[]UpstreamUpstreams represents the configuration for the upstream servers.
    Requests will be proxied to this upstream if the path matches the request path.
    Copyright © 2021 OAuth2 Proxy.
    +Requests will be proxied to this upstream if the path matches the request path.

    FieldTypeDescription
    idstringID should be a unique identifier for the upstream.
    This value is required for all upstreams.
    pathstringPath is used to map requests to the upstream server.
    The closest match will take precedence and all Paths must be unique.
    Path can also take a pattern when used with RewriteTarget.
    Path segments can be captured and matched using regular experessions.
    Eg:
    - ^/foo$: Match only the explicit path /foo
    - ^/bar/$: Match any path prefixed with /bar/
    - ^/baz/(.*)$: Match any path prefixed with /baz and capture the remaining path for use with RewriteTarget
    rewriteTargetstringRewriteTarget allows users to rewrite the request path before it is sent to
    the upstream server.
    Use the Path to capture segments for reuse within the rewrite target.
    Eg: With a Path of ^/baz/(.*), a RewriteTarget of /foo/$1 would rewrite
    the request /baz/abc/123 to /foo/abc/123 before proxying to the
    upstream server.
    uristringThe URI of the upstream server. This may be an HTTP(S) server of a File
    based URL. It may include a path, in which case all requests will be served
    under that path.
    Eg:
    - http://localhost:8080
    - https://service.localhost
    - https://service.localhost/path
    - file://host/path
    If the URI's path is "/base" and the incoming request was for "/dir",
    the upstream request will be for "/base/dir".
    insecureSkipTLSVerifyboolInsecureSkipTLSVerify will skip TLS verification of upstream HTTPS hosts.
    This option is insecure and will allow potential Man-In-The-Middle attacks
    betweem OAuth2 Proxy and the usptream server.
    Defaults to false.
    staticboolStatic will make all requests to this upstream have a static response.
    The response will have a body of "Authenticated" and a response code
    matching StaticCode.
    If StaticCode is not set, the response will return a 200 response.
    staticCodeintStaticCode determines the response code for the Static response.
    This option can only be used with Static enabled.
    flushIntervalDurationFlushInterval is the period between flushing the response buffer when
    streaming response from the upstream.
    Defaults to 1 second.
    passHostHeaderboolPassHostHeader determines whether the request host header should be proxied
    to the upstream server.
    Defaults to true.
    proxyWebSocketsboolProxyWebSockets enables proxying of websockets to upstream servers
    Defaults to true.

    UpstreamConfig

    (Appears on: AlphaOptions)

    UpstreamConfig is a collection of definitions for upstream servers.

    FieldTypeDescription
    proxyRawPathboolProxyRawPath will pass the raw url path to upstream allowing for url's
    like: "/%2F/" which would otherwise be redirected to "/"
    upstreams[]UpstreamUpstreams represents the configuration for the upstream servers.
    Requests will be proxied to this upstream if the path matches the request path.
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/configuration/oauth_provider/index.html b/docs/configuration/oauth_provider/index.html index 99d230d0..d0fedbbb 100644 --- a/docs/configuration/oauth_provider/index.html +++ b/docs/configuration/oauth_provider/index.html @@ -6,8 +6,8 @@ OAuth Provider Configuration | OAuth2 Proxy - - + + @@ -57,10 +57,10 @@ to setup the client id and client secret. Your "Redirection URI" will https://internalapp.yourcompany.com/oauth2/callback.

    -provider nextcloud
    -client-id <from nextcloud admin>
    -client-secret <from nextcloud admin>
    -login-url="<your nextcloud url>/index.php/apps/oauth2/authorize"
    -redeem-url="<your nextcloud url>/index.php/apps/oauth2/api/v1/token"
    -validate-url="<your nextcloud url>/ocs/v2.php/cloud/user?format=json"

    Note: in all cases the validate-url will not have the index.php.

    DigitalOcean Auth Provider

    1. Create a new OAuth application
      • You can fill in the name, homepage, and description however you wish.
      • In the "Application callback URL" field, enter: https://oauth-proxy/oauth2/callback, substituting oauth2-proxy with the actual hostname that oauth2-proxy is running on. The URL must match oauth2-proxy's configured redirect URL.
    2. Note the Client ID and Client Secret.

    To use the provider, pass the following options:

    --provider=digitalocean
    --client-id=<Client ID>
    --client-secret=<Client Secret>

    Alternatively, set the equivalent options in the config file. The redirect URL defaults to https://<requested host header>/oauth2/callback. If you need to change it, you can use the --redirect-url command-line option.

    Bitbucket Auth Provider

    1. Add a new OAuth consumer
      • In "Callback URL" use https://<oauth2-proxy>/oauth2/callback, substituting <oauth2-proxy> with the actual hostname that oauth2-proxy is running on.
      • In Permissions section select:
        • Account -> Email
        • Team membership -> Read
        • Repositories -> Read
    2. Note the Client ID and Client Secret.

    To use the provider, pass the following options:

    --provider=bitbucket
    --client-id=<Client ID>
    --client-secret=<Client Secret>

    The default configuration allows everyone with Bitbucket account to authenticate. To restrict the access to the team members use additional configuration option: --bitbucket-team=<Team name>. To restrict the access to only these users who has access to one selected repository use --bitbucket-repository=<Repository name>.

    Gitea Auth Provider

    1. Create a new application: https://< your gitea host >/user/settings/applications
    2. Under Redirect URI enter the correct URL i.e. https://<proxied host>/oauth2/callback
    3. Note the Client ID and Client Secret.
    4. Pass the following options to the proxy:
    --provider="github"
    --redirect-url="https://<proxied host>/oauth2/callback"
    --provider-display-name="Gitea"
    --client-id="< client_id as generated by Gitea >"
    --client-secret="< client_secret as generated by Gitea >"
    --login-url="https://< your gitea host >/login/oauth/authorize"
    --redeem-url="https://< your gitea host >/login/oauth/access_token"
    --validate-url="https://< your gitea host >/api/v1"

    Email Authentication

    To authorize by email domain use --email-domain=yourcompany.com. To authorize individual email addresses use --authenticated-emails-file=/path/to/file with one email per line. To authorize all email addresses use --email-domain=*.

    Adding a new Provider

    Follow the examples in the providers package to define a new Provider instance. Add a new case to providers.New() to allow oauth2-proxy to use the -new Provider.

    Copyright © 2021 OAuth2 Proxy.
    +new Provider.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/configuration/overview/index.html b/docs/configuration/overview/index.html index 153927b2..577a449c 100644 --- a/docs/configuration/overview/index.html +++ b/docs/configuration/overview/index.html @@ -6,8 +6,8 @@ Overview | OAuth2 Proxy - - + + @@ -41,10 +41,10 @@ Note that nginxinc/kubernetes-ingress does not include the Lua modu
    services:
    a-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.2:7555
    oauth-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.1:4180
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    oauth-errors:
    errors:
    status:
    - "401-403"
    service: oauth-backend
    query: "/oauth2/sign_in"

    ForwardAuth with static upstreams configuration

    Redirect to sign_in functionality provided without the use of errors middleware with Traefik v2 ForwardAuth middleware pointing to oauth2-proxy service's / endpoint

    Following options need to be set on oauth2-proxy:

    • --upstream=static://202: Configures a static response for authenticated sessions
    • --reverse-proxy=true: Enables the use of X-Forwarded-* headers to determine redirects correctly
    http:
    routers:
    a-service-route-1:
    rule: "Host(`a-service.example.com`, `b-service.example.com`) && PathPrefix(`/`)"
    service: a-service-backend
    middlewares:
    - oauth-auth-redirect # redirects all unauthenticated to oauth2 signin
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    a-service-route-2:
    rule: "Host(`a-service.example.com`) && PathPrefix(`/no-auto-redirect`)"
    service: a-service-backend
    middlewares:
    - oauth-auth-wo-redirect # unauthenticated session will return a 401
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    services-oauth2-route:
    rule: "Host(`a-service.example.com`, `b-service.example.com`) && PathPrefix(`/oauth2/`)"
    middlewares:
    - auth-headers
    service: oauth-backend
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    oauth2-proxy-route:
    rule: "Host(`oauth.example.com`) && PathPrefix(`/`)"
    middlewares:
    - auth-headers
    service: oauth-backend
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    services:
    a-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.2:7555
    b-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.3:7555
    oauth-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.1:4180
    -
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth-redirect:
    forwardAuth:
    address: https://oauth.example.com/
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    oauth-auth-wo-redirect:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    note

    If you set up your OAuth2 provider to rotate your client secret, you can use the client-secret-file option to reload the secret when it is updated.

    Copyright © 2021 OAuth2 Proxy.
    +
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth-redirect:
    forwardAuth:
    address: https://oauth.example.com/
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    oauth-auth-wo-redirect:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    note

    If you set up your OAuth2 provider to rotate your client secret, you can use the client-secret-file option to reload the secret when it is updated.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/configuration/session_storage/index.html b/docs/configuration/session_storage/index.html index ac7d3c4c..8376eafb 100644 --- a/docs/configuration/session_storage/index.html +++ b/docs/configuration/session_storage/index.html @@ -6,8 +6,8 @@ Session Storage | OAuth2 Proxy - - + + @@ -33,10 +33,10 @@ disclosure.

    Copyright © 2021 OAuth2 Proxy.
    +--redis-use-cluster=true flag, and configure the flags --redis-cluster-connection-urls appropriately.

    Note that flags --redis-use-sentinel=true and --redis-use-cluster=true are mutually exclusive.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/configuration/tls/index.html b/docs/configuration/tls/index.html index 891b5d62..d75a0946 100644 --- a/docs/configuration/tls/index.html +++ b/docs/configuration/tls/index.html @@ -6,8 +6,8 @@ TLS Configuration | OAuth2 Proxy - - + + @@ -24,10 +24,10 @@ external load balancer like Amazon ELB or Google Platform Load Balancing) use oauth2-proxy will then authenticate requests for an upstream application. The external endpoint for this example would be https://internal.yourcompany.com/.

    An example Nginx config follows. Note the use of Strict-Transport-Security header to pin requests to SSL via HSTS:

    server {
    listen 443 default ssl;
    server_name internal.yourcompany.com;
    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/cert.key;
    add_header Strict-Transport-Security max-age=2592000;
    -
    location / {
    proxy_pass http://127.0.0.1:4180;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_connect_timeout 1;
    proxy_send_timeout 30;
    proxy_read_timeout 30;
    }
    }

    The command line to run oauth2-proxy in this configuration would look like this:

    ./oauth2-proxy \
    --email-domain="yourcompany.com" \
    --upstream=http://127.0.0.1:8080/ \
    --cookie-secret=... \
    --cookie-secure=true \
    --provider=... \
    --reverse-proxy=true \
    --client-id=... \
    --client-secret=...
    Copyright © 2021 OAuth2 Proxy.
    +
    location / {
    proxy_pass http://127.0.0.1:4180;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_connect_timeout 1;
    proxy_send_timeout 30;
    proxy_read_timeout 30;
    }
    }

    The command line to run oauth2-proxy in this configuration would look like this:

    ./oauth2-proxy \
    --email-domain="yourcompany.com" \
    --upstream=http://127.0.0.1:8080/ \
    --cookie-secret=... \
    --cookie-secure=true \
    --provider=... \
    --reverse-proxy=true \
    --client-id=... \
    --client-secret=...
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/features/endpoints/index.html b/docs/features/endpoints/index.html index 2f954281..7bab1cdb 100644 --- a/docs/features/endpoints/index.html +++ b/docs/features/endpoints/index.html @@ -6,8 +6,8 @@ Endpoints | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: 7.2.x

    Endpoints

    OAuth2 Proxy responds directly to the following endpoints. All other endpoints will be proxied upstream when authenticated. The /oauth2 prefix can be changed with the --proxy-prefix config variable.

    • /robots.txt - returns a 200 OK response that disallows all User-agents from all paths; see robotstxt.org for more info
    • /ping - returns a 200 OK response, which is intended for use with health checks
    • /metrics - Metrics endpoint for Prometheus to scrape, serve on the address specified by --metrics-address, disabled by default
    • /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
    • /oauth2/sign_out - this URL is used to clear the session cookie
    • /oauth2/start - a URL that will redirect to start the OAuth cycle
    • /oauth2/callback - the URL used at the end of the OAuth cycle. The oauth app will be configured with this as the callback url.
    • /oauth2/userinfo - the URL is used to return user's email from the session in JSON format.
    • /oauth2/auth - only returns a 202 Accepted response or a 401 Unauthorized response; for use with the Nginx auth_request directive

    Sign out

    To sign the user out, redirect them to /oauth2/sign_out. This endpoint only removes oauth2-proxy's own cookies, i.e. the user is still logged in with the authentication provider and may automatically re-login when accessing the application again. You will also need to redirect the user to the authentication provider's sign out page afterwards using the rd query parameter, i.e. redirect the user to something like (notice the url-encoding!):

    /oauth2/sign_out?rd=https%3A%2F%2Fmy-oidc-provider.example.com%2Fsign_out_page

    Alternatively, include the redirect URL in the X-Auth-Request-Redirect header:

    GET /oauth2/sign_out HTTP/1.1
    X-Auth-Request-Redirect: https://my-oidc-provider/sign_out_page
    ...

    (The "sign_out_page" should be the end_session_endpoint from the metadata if your OIDC provider supports Session Management and Discovery.)

    BEWARE that the domain you want to redirect to (my-oidc-provider.example.com in the example) must be added to the --whitelist-domain configuration option otherwise the redirect will be ignored.

    Copyright © 2021 OAuth2 Proxy.
    +
    Version: 7.2.x

    Endpoints

    OAuth2 Proxy responds directly to the following endpoints. All other endpoints will be proxied upstream when authenticated. The /oauth2 prefix can be changed with the --proxy-prefix config variable.

    • /robots.txt - returns a 200 OK response that disallows all User-agents from all paths; see robotstxt.org for more info
    • /ping - returns a 200 OK response, which is intended for use with health checks
    • /metrics - Metrics endpoint for Prometheus to scrape, serve on the address specified by --metrics-address, disabled by default
    • /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
    • /oauth2/sign_out - this URL is used to clear the session cookie
    • /oauth2/start - a URL that will redirect to start the OAuth cycle
    • /oauth2/callback - the URL used at the end of the OAuth cycle. The oauth app will be configured with this as the callback url.
    • /oauth2/userinfo - the URL is used to return user's email from the session in JSON format.
    • /oauth2/auth - only returns a 202 Accepted response or a 401 Unauthorized response; for use with the Nginx auth_request directive

    Sign out

    To sign the user out, redirect them to /oauth2/sign_out. This endpoint only removes oauth2-proxy's own cookies, i.e. the user is still logged in with the authentication provider and may automatically re-login when accessing the application again. You will also need to redirect the user to the authentication provider's sign out page afterwards using the rd query parameter, i.e. redirect the user to something like (notice the url-encoding!):

    /oauth2/sign_out?rd=https%3A%2F%2Fmy-oidc-provider.example.com%2Fsign_out_page

    Alternatively, include the redirect URL in the X-Auth-Request-Redirect header:

    GET /oauth2/sign_out HTTP/1.1
    X-Auth-Request-Redirect: https://my-oidc-provider/sign_out_page
    ...

    (The "sign_out_page" should be the end_session_endpoint from the metadata if your OIDC provider supports Session Management and Discovery.)

    BEWARE that the domain you want to redirect to (my-oidc-provider.example.com in the example) must be added to the --whitelist-domain configuration option otherwise the redirect will be ignored.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/index.html b/docs/index.html index ac7ed502..f813ddcb 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,8 +6,8 @@ Installation | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: 7.2.x

    Installation

    1. Choose how to deploy:

      a. Download Prebuilt Binary (current release is v7.2.1)

      b. Build with $ go get github.com/oauth2-proxy/oauth2-proxy/v7 which will put the binary in $GOPATH/bin

      c. Using the prebuilt docker image quay.io/oauth2-proxy/oauth2-proxy (AMD64, ARMv6 and ARM64 tags available)

      d. Using a Kubernetes manifest (Helm)

    Prebuilt binaries can be validated by extracting the file and verifying it against the sha256sum.txt checksum file provided for each release starting with version v3.0.0.

    $ sha256sum -c sha256sum.txt
    oauth2-proxy-x.y.z.linux-amd64: OK
    1. Select a Provider and Register an OAuth Application with a Provider
    2. Configure OAuth2 Proxy using config file, command line options, or environment variables
    3. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
    Copyright © 2021 OAuth2 Proxy.
    +
    Version: 7.2.x

    Installation

    1. Choose how to deploy:

      a. Download Prebuilt Binary (current release is v7.2.1)

      b. Build with $ go get github.com/oauth2-proxy/oauth2-proxy/v7 which will put the binary in $GOPATH/bin

      c. Using the prebuilt docker image quay.io/oauth2-proxy/oauth2-proxy (AMD64, ARMv6 and ARM64 tags available)

      d. Using a Kubernetes manifest (Helm)

    Prebuilt binaries can be validated by extracting the file and verifying it against the sha256sum.txt checksum file provided for each release starting with version v3.0.0.

    $ sha256sum -c sha256sum.txt
    oauth2-proxy-x.y.z.linux-amd64: OK
    1. Select a Provider and Register an OAuth Application with a Provider
    2. Configure OAuth2 Proxy using config file, command line options, or environment variables
    3. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/next/behaviour/index.html b/docs/next/behaviour/index.html index e2780b04..40fe9138 100644 --- a/docs/next/behaviour/index.html +++ b/docs/next/behaviour/index.html @@ -6,8 +6,8 @@ Behaviour | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: Next

    Behaviour

    1. Any request passing through the proxy (and not matched by --skip-auth-regex) is checked for the proxy's session cookie (--cookie-name) (or, if allowed, a JWT token - see --skip-jwt-bearer-tokens).
    2. If authentication is required but missing then the user is asked to log in and redirected to the authentication provider (unless it is an Ajax request, i.e. one with Accept: application/json, in which case 401 Unauthorized is returned)
    3. After returning from the authentication provider, the oauth tokens are stored in the configured session store (cookie, redis, ...) and a cookie is set
    4. The request is forwarded to the upstream server with added user info and authentication headers (depending on the configuration)

    Notice that the proxy also provides a number of useful endpoints.

    Copyright © 2021 OAuth2 Proxy.
    +
    Version: Next

    Behaviour

    1. Any request passing through the proxy (and not matched by --skip-auth-regex) is checked for the proxy's session cookie (--cookie-name) (or, if allowed, a JWT token - see --skip-jwt-bearer-tokens).
    2. If authentication is required but missing then the user is asked to log in and redirected to the authentication provider (unless it is an Ajax request, i.e. one with Accept: application/json, in which case 401 Unauthorized is returned)
    3. After returning from the authentication provider, the oauth tokens are stored in the configured session store (cookie, redis, ...) and a cookie is set
    4. The request is forwarded to the upstream server with added user info and authentication headers (depending on the configuration)

    Notice that the proxy also provides a number of useful endpoints.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/next/community/security/index.html b/docs/next/community/security/index.html index fca1f301..1bd9c3fa 100644 --- a/docs/next/community/security/index.html +++ b/docs/next/community/security/index.html @@ -6,8 +6,8 @@ Security | OAuth2 Proxy - - + + @@ -36,10 +36,10 @@ dependencies), we may use regular PRs for fixes and forego the security advisory If we have multiple security issues in flight simultaneously, we may delay merging fixes until all patches are ready. We may also backport the fix to previous releases, -but this will be at the discretion of the maintainers.

    Copyright © 2021 OAuth2 Proxy.
    +but this will be at the discretion of the maintainers.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/next/configuration/alpha-config/index.html b/docs/next/configuration/alpha-config/index.html index 14a1a9da..36827db2 100644 --- a/docs/next/configuration/alpha-config/index.html +++ b/docs/next/configuration/alpha-config/index.html @@ -6,8 +6,8 @@ Alpha Configuration | OAuth2 Proxy - - + + @@ -42,10 +42,10 @@ Valid time units are "ns", "us" (or "µs"), " response header.

    FieldTypeDescription
    namestringName is the header name to be used for this set of values.
    Names should be unique within a list of Headers.
    preserveRequestValueboolPreserveRequestValue determines whether any values for this header
    should be preserved for the request to the upstream server.
    This option only applies to injected request headers.
    Defaults to false (headers that match this header will be stripped).
    values[]HeaderValueValues contains the desired values for this header

    HeaderValue

    (Appears on: Header)

    HeaderValue represents a single header value and the sources that can make up the header value

    FieldTypeDescription
    value[]byteValue expects a base64 encoded string value.
    fromEnvstringFromEnv expects the name of an environment variable.
    fromFilestringFromFile expects a path to a file containing the secret value.
    claimstringClaim is the name of the claim in the session that the value should be
    loaded from.
    prefixstringPrefix is an optional prefix that will be prepended to the value of the
    claim if it is non-empty.
    basicAuthPasswordSecretSourceBasicAuthPassword converts this claim into a basic auth header.
    Note the value of claim will become the basic auth username and the
    basicAuthPassword will be used as the password value.

    KeycloakOptions

    (Appears on: Provider)

    FieldTypeDescription
    groups[]stringGroup enables to restrict login to members of indicated group
    roles[]stringRole enables to restrict login to users with role (only available when using the keycloak-oidc provider)

    LoginGovOptions

    (Appears on: Provider)

    FieldTypeDescription
    jwtKeystringJWTKey is a private key in PEM format used to sign JWT,
    jwtKeyFilestringJWTKeyFile is a path to the private key file in PEM format used to sign the JWT
    pubjwkURLstringPubJWKURL is the JWK pubkey access endpoint

    OIDCOptions

    (Appears on: Provider)

    FieldTypeDescription
    issuerURLstringIssuerURL is the OpenID Connect issuer URL
    eg: https://accounts.google.com
    insecureAllowUnverifiedEmailboolInsecureAllowUnverifiedEmail prevents failures if an email address in an id_token is not verified
    default set to 'false'
    insecureSkipIssuerVerificationboolInsecureSkipIssuerVerification skips verification of ID token issuers. When false, ID Token Issuers must match the OIDC discovery URL
    default set to 'false'
    insecureSkipNonceboolInsecureSkipNonce skips verifying the ID Token's nonce claim that must match
    the random nonce sent in the initial OAuth flow. Otherwise, the nonce is checked
    after the initial OAuth redeem & subsequent token refreshes.
    default set to 'true'
    Warning: In a future release, this will change to 'false' by default for enhanced security.
    skipDiscoveryboolSkipDiscovery allows to skip OIDC discovery and use manually supplied Endpoints
    default set to 'false'
    jwksURLstringJwksURL is the OpenID Connect JWKS URL
    eg: https://www.googleapis.com/oauth2/v3/certs
    emailClaimstringEmailClaim indicates which claim contains the user email,
    default set to 'email'
    groupsClaimstringGroupsClaim indicates which claim contains the user groups
    default set to 'groups'
    userIDClaimstringUserIDClaim indicates which claim contains the user ID
    default set to 'email'

    Provider

    (Appears on: Providers)

    Provider holds all configuration for a single provider

    FieldTypeDescription
    clientIDstringClientID is the OAuth Client ID that is defined in the provider
    This value is required for all providers.
    clientSecretstringClientSecret is the OAuth Client Secret that is defined in the provider
    This value is required for all providers.
    clientSecretFilestringClientSecretFile is the name of the file
    containing the OAuth Client Secret, it will be used if ClientSecret is not set.
    keycloakConfigKeycloakOptionsKeycloakConfig holds all configurations for Keycloak provider.
    azureConfigAzureOptionsAzureConfig holds all configurations for Azure provider.
    ADFSConfigADFSOptionsADFSConfig holds all configurations for ADFS provider.
    bitbucketConfigBitbucketOptionsBitbucketConfig holds all configurations for Bitbucket provider.
    githubConfigGitHubOptionsGitHubConfig holds all configurations for GitHubC provider.
    gitlabConfigGitLabOptionsGitLabConfig holds all configurations for GitLab provider.
    googleConfigGoogleOptionsGoogleConfig holds all configurations for Google provider.
    oidcConfigOIDCOptionsOIDCConfig holds all configurations for OIDC provider
    or providers utilize OIDC configurations.
    loginGovConfigLoginGovOptionsLoginGovConfig holds all configurations for LoginGov provider.
    idstringID should be a unique identifier for the provider.
    This value is required for all providers.
    providerstringType is the OAuth provider
    must be set from the supported providers group,
    otherwise 'Google' is set as default
    namestringName is the providers display name
    if set, it will be shown to the users in the login page.
    caFiles[]stringCAFiles is a list of paths to CA certificates that should be used when connecting to the provider.
    If not specified, the default Go trust sources are used instead
    loginURLstringLoginURL is the authentication endpoint
    redeemURLstringRedeemURL is the token redemption endpoint
    profileURLstringProfileURL is the profile access endpoint
    resourcestringProtectedResource is the resource that is protected (Azure AD and ADFS only)
    validateURLstringValidateURL is the access token validation endpoint
    scopestringScope is the OAuth scope specification
    promptstringPrompt is OIDC prompt
    approvalPromptstringApprovalPrompt is the OAuth approval_prompt
    default is set to 'force'
    allowedGroups[]stringAllowedGroups is a list of restrict logins to members of this group
    acrValuesstringAcrValues is a string of acr values

    Providers

    ([]Provider alias)

    (Appears on: AlphaOptions)

    Providers is a collection of definitions for providers.

    SecretSource

    (Appears on: ClaimSource, HeaderValue, TLS)

    SecretSource references an individual secret value. Only one source within the struct should be defined at any time.

    FieldTypeDescription
    value[]byteValue expects a base64 encoded string value.
    fromEnvstringFromEnv expects the name of an environment variable.
    fromFilestringFromFile expects a path to a file containing the secret value.

    Server

    (Appears on: AlphaOptions)

    Server represents the configuration for an HTTP(S) server

    FieldTypeDescription
    BindAddressstringBindAddress is the address on which to serve traffic.
    Leave blank or set to "-" to disable.
    SecureBindAddressstringSecureBindAddress is the address on which to serve secure traffic.
    Leave blank or set to "-" to disable.
    TLSTLSTLS contains the information for loading the certificate and key for the
    secure traffic.

    TLS

    (Appears on: Server)

    TLS contains the information for loading a TLS certifcate and key.

    FieldTypeDescription
    KeySecretSourceKey is the TLS key data to use.
    Typically this will come from a file.
    CertSecretSourceCert is the TLS certificate data to use.
    Typically this will come from a file.

    Upstream

    (Appears on: UpstreamConfig)

    Upstream represents the configuration for an upstream server. -Requests will be proxied to this upstream if the path matches the request path.

    FieldTypeDescription
    idstringID should be a unique identifier for the upstream.
    This value is required for all upstreams.
    pathstringPath is used to map requests to the upstream server.
    The closest match will take precedence and all Paths must be unique.
    Path can also take a pattern when used with RewriteTarget.
    Path segments can be captured and matched using regular experessions.
    Eg:
    - ^/foo$: Match only the explicit path /foo
    - ^/bar/$: Match any path prefixed with /bar/
    - ^/baz/(.*)$: Match any path prefixed with /baz and capture the remaining path for use with RewriteTarget
    rewriteTargetstringRewriteTarget allows users to rewrite the request path before it is sent to
    the upstream server.
    Use the Path to capture segments for reuse within the rewrite target.
    Eg: With a Path of ^/baz/(.*), a RewriteTarget of /foo/$1 would rewrite
    the request /baz/abc/123 to /foo/abc/123 before proxying to the
    upstream server.
    uristringThe URI of the upstream server. This may be an HTTP(S) server of a File
    based URL. It may include a path, in which case all requests will be served
    under that path.
    Eg:
    - http://localhost:8080
    - https://service.localhost
    - https://service.localhost/path
    - file://host/path
    If the URI's path is "/base" and the incoming request was for "/dir",
    the upstream request will be for "/base/dir".
    insecureSkipTLSVerifyboolInsecureSkipTLSVerify will skip TLS verification of upstream HTTPS hosts.
    This option is insecure and will allow potential Man-In-The-Middle attacks
    betweem OAuth2 Proxy and the usptream server.
    Defaults to false.
    staticboolStatic will make all requests to this upstream have a static response.
    The response will have a body of "Authenticated" and a response code
    matching StaticCode.
    If StaticCode is not set, the response will return a 200 response.
    staticCodeintStaticCode determines the response code for the Static response.
    This option can only be used with Static enabled.
    flushIntervalDurationFlushInterval is the period between flushing the response buffer when
    streaming response from the upstream.
    Defaults to 1 second.
    passHostHeaderboolPassHostHeader determines whether the request host header should be proxied
    to the upstream server.
    Defaults to true.
    proxyWebSocketsboolProxyWebSockets enables proxying of websockets to upstream servers
    Defaults to true.

    UpstreamConfig

    (Appears on: AlphaOptions)

    UpstreamConfig is a collection of definitions for upstream servers.

    FieldTypeDescription
    proxyRawPathboolProxyRawPath will pass the raw url path to upstream allowing for url's
    like: "/%2F/" which would otherwise be redirected to "/"
    upstreams[]UpstreamUpstreams represents the configuration for the upstream servers.
    Requests will be proxied to this upstream if the path matches the request path.
    Copyright © 2021 OAuth2 Proxy.
    +Requests will be proxied to this upstream if the path matches the request path.

    FieldTypeDescription
    idstringID should be a unique identifier for the upstream.
    This value is required for all upstreams.
    pathstringPath is used to map requests to the upstream server.
    The closest match will take precedence and all Paths must be unique.
    Path can also take a pattern when used with RewriteTarget.
    Path segments can be captured and matched using regular experessions.
    Eg:
    - ^/foo$: Match only the explicit path /foo
    - ^/bar/$: Match any path prefixed with /bar/
    - ^/baz/(.*)$: Match any path prefixed with /baz and capture the remaining path for use with RewriteTarget
    rewriteTargetstringRewriteTarget allows users to rewrite the request path before it is sent to
    the upstream server.
    Use the Path to capture segments for reuse within the rewrite target.
    Eg: With a Path of ^/baz/(.*), a RewriteTarget of /foo/$1 would rewrite
    the request /baz/abc/123 to /foo/abc/123 before proxying to the
    upstream server.
    uristringThe URI of the upstream server. This may be an HTTP(S) server of a File
    based URL. It may include a path, in which case all requests will be served
    under that path.
    Eg:
    - http://localhost:8080
    - https://service.localhost
    - https://service.localhost/path
    - file://host/path
    If the URI's path is "/base" and the incoming request was for "/dir",
    the upstream request will be for "/base/dir".
    insecureSkipTLSVerifyboolInsecureSkipTLSVerify will skip TLS verification of upstream HTTPS hosts.
    This option is insecure and will allow potential Man-In-The-Middle attacks
    betweem OAuth2 Proxy and the usptream server.
    Defaults to false.
    staticboolStatic will make all requests to this upstream have a static response.
    The response will have a body of "Authenticated" and a response code
    matching StaticCode.
    If StaticCode is not set, the response will return a 200 response.
    staticCodeintStaticCode determines the response code for the Static response.
    This option can only be used with Static enabled.
    flushIntervalDurationFlushInterval is the period between flushing the response buffer when
    streaming response from the upstream.
    Defaults to 1 second.
    passHostHeaderboolPassHostHeader determines whether the request host header should be proxied
    to the upstream server.
    Defaults to true.
    proxyWebSocketsboolProxyWebSockets enables proxying of websockets to upstream servers
    Defaults to true.

    UpstreamConfig

    (Appears on: AlphaOptions)

    UpstreamConfig is a collection of definitions for upstream servers.

    FieldTypeDescription
    proxyRawPathboolProxyRawPath will pass the raw url path to upstream allowing for url's
    like: "/%2F/" which would otherwise be redirected to "/"
    upstreams[]UpstreamUpstreams represents the configuration for the upstream servers.
    Requests will be proxied to this upstream if the path matches the request path.
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/next/configuration/oauth_provider/index.html b/docs/next/configuration/oauth_provider/index.html index c0dc188e..9268f534 100644 --- a/docs/next/configuration/oauth_provider/index.html +++ b/docs/next/configuration/oauth_provider/index.html @@ -6,15 +6,15 @@ OAuth Provider Configuration | OAuth2 Proxy - - + + - +
    @@ -28,7 +28,7 @@ The OpenID Connect Provider (OIDC) can also be used to connect to other Identity you may wish to configure an authorization server for each application. Otherwise, the provided default will work.
    • Navigate to Security then select API
    • Click Add Authorization Server, if this option is not available you may require an additional license for a custom authorization server.
    • Fill out the Name with something to describe the application you are protecting. e.g. 'Example App'.
    • For Audience, pick the URL of the application you wish to protect: https://example.corp.com
    • Fill out a Description
    • Add any Access Policies you wish to configure to limit application access.
    • The default settings will work for other options. See Okta documentation for more information on Authorization Servers
    1. Navigate to Applications then select Add Application.
    • Select Web for the Platform setting.
    • Select OpenID Connect and click Create
    • Pick an Application Name such as Example App.
    • Set the Login redirect URI to https://example.corp.com.
    • Under General set the Allowed grant types to Authorization Code and Refresh Token.
    • Leave the rest as default, taking note of the Client ID and Client Secret.
    • Under Assignments select the users or groups you wish to access your application.
    1. Create a configuration file like the following:

      provider = "oidc"
      redirect_url = "https://example.corp.com/oauth2/callback"
      oidc_issuer_url = "https://corp.okta.com/oauth2/abCd1234"
      upstreams = [
      "https://example.corp.com"
      ]
      email_domains = [
      "corp.com"
      ]
      client_id = "XXXXX"
      client_secret = "YYYYY"
      pass_access_token = true
      cookie_secret = "ZZZZZ"
      skip_provider_button = true

    The oidc_issuer_url is based on URL from your Authorization Server's Issuer field in step 2, or simply https://corp.okta.com . The client_id and client_secret are configured in the application settings. -Generate a unique client_secret to encrypt the cookie.

    Then you can start the oauth2-proxy with ./oauth2-proxy --config /etc/example.cfg

    Okta - localhost

    1. Signup for developer account: https://developer.okta.com/signup/
    2. Create New Web Application: https://${your-okta-domain}/dev/console/apps/new
    3. Example Application Settings for localhost:
      • Name: My Web App
      • Base URIs: http://localhost:4180/
      • Login redirect URIs: http://localhost:4180/oauth2/callback
      • Logout redirect URIs: http://localhost:4180/
      • Group assignments: Everyone
      • Grant type allowed: Authorization Code and Refresh Token
    4. Make note of the Client ID and Client secret, they are needed in a future step
    5. Make note of the default Authorization Server Issuer URI from: https://${your-okta-domain}/admin/oauth2/as
    6. Example config file /etc/localhost.cfg
      provider = "oidc"
      redirect_url = "http://localhost:4180/oauth2/callback"
      oidc_issuer_url = "https://${your-okta-domain}/oauth2/default"
      upstreams = [
      "http://0.0.0.0:8080"
      ]
      email_domains = [
      "*"
      ]
      client_id = "XXX"
      client_secret = "YYY"
      pass_access_token = true
      cookie_secret = "ZZZ"
      cookie_secure = false
      skip_provider_button = true
      # Note: use the following for testing within a container
      # http_address = "0.0.0.0:4180"
    7. Then you can start the oauth2-proxy with ./oauth2-proxy --config /etc/localhost.cfg

    login.gov Provider

    login.gov is an OIDC provider for the US Government. +Generate a unique cookie_secret to encrypt the cookie.

    Then you can start the oauth2-proxy with ./oauth2-proxy --config /etc/example.cfg

    Okta - localhost

    1. Signup for developer account: https://developer.okta.com/signup/
    2. Create New Web Application: https://${your-okta-domain}/dev/console/apps/new
    3. Example Application Settings for localhost:
      • Name: My Web App
      • Base URIs: http://localhost:4180/
      • Login redirect URIs: http://localhost:4180/oauth2/callback
      • Logout redirect URIs: http://localhost:4180/
      • Group assignments: Everyone
      • Grant type allowed: Authorization Code and Refresh Token
    4. Make note of the Client ID and Client secret, they are needed in a future step
    5. Make note of the default Authorization Server Issuer URI from: https://${your-okta-domain}/admin/oauth2/as
    6. Example config file /etc/localhost.cfg
      provider = "oidc"
      redirect_url = "http://localhost:4180/oauth2/callback"
      oidc_issuer_url = "https://${your-okta-domain}/oauth2/default"
      upstreams = [
      "http://0.0.0.0:8080"
      ]
      email_domains = [
      "*"
      ]
      client_id = "XXX"
      client_secret = "YYY"
      pass_access_token = true
      cookie_secret = "ZZZ"
      cookie_secure = false
      skip_provider_button = true
      # Note: use the following for testing within a container
      # http_address = "0.0.0.0:4180"
    7. Then you can start the oauth2-proxy with ./oauth2-proxy --config /etc/localhost.cfg

    login.gov Provider

    login.gov is an OIDC provider for the US Government. If you are a US Government agency, you can contact the login.gov team through the contact information that you can find on https://login.gov/developers/ and work with them to understand how to get login.gov accounts for integration/test and production access.

    A developer guide is available here: https://developers.login.gov/, though this proxy handles everything @@ -57,16 +57,16 @@ to setup the client id and client secret. Your "Redirection URI" will https://internalapp.yourcompany.com/oauth2/callback.

    -provider nextcloud
    -client-id <from nextcloud admin>
    -client-secret <from nextcloud admin>
    -login-url="<your nextcloud url>/index.php/apps/oauth2/authorize"
    -redeem-url="<your nextcloud url>/index.php/apps/oauth2/api/v1/token"
    -validate-url="<your nextcloud url>/ocs/v2.php/cloud/user?format=json"

    Note: in all cases the validate-url will not have the index.php.

    DigitalOcean Auth Provider

    1. Create a new OAuth application
      • You can fill in the name, homepage, and description however you wish.
      • In the "Application callback URL" field, enter: https://oauth-proxy/oauth2/callback, substituting oauth2-proxy with the actual hostname that oauth2-proxy is running on. The URL must match oauth2-proxy's configured redirect URL.
    2. Note the Client ID and Client Secret.

    To use the provider, pass the following options:

    --provider=digitalocean
    --client-id=<Client ID>
    --client-secret=<Client Secret>

    Alternatively, set the equivalent options in the config file. The redirect URL defaults to https://<requested host header>/oauth2/callback. If you need to change it, you can use the --redirect-url command-line option.

    Bitbucket Auth Provider

    1. Add a new OAuth consumer
      • In "Callback URL" use https://<oauth2-proxy>/oauth2/callback, substituting <oauth2-proxy> with the actual hostname that oauth2-proxy is running on.
      • In Permissions section select:
        • Account -> Email
        • Team membership -> Read
        • Repositories -> Read
    2. Note the Client ID and Client Secret.

    To use the provider, pass the following options:

    --provider=bitbucket
    --client-id=<Client ID>
    --client-secret=<Client Secret>

    The default configuration allows everyone with Bitbucket account to authenticate. To restrict the access to the team members use additional configuration option: --bitbucket-team=<Team name>. To restrict the access to only these users who has access to one selected repository use --bitbucket-repository=<Repository name>.

    Gitea Auth Provider

    1. Create a new application: https://< your gitea host >/user/settings/applications
    2. Under Redirect URI enter the correct URL i.e. https://<proxied host>/oauth2/callback
    3. Note the Client ID and Client Secret.
    4. Pass the following options to the proxy:
    --provider="github"
    --redirect-url="https://<proxied host>/oauth2/callback"
    --provider-display-name="Gitea"
    --client-id="< client_id as generated by Gitea >"
    --client-secret="< client_secret as generated by Gitea >"
    --login-url="https://< your gitea host >/login/oauth/authorize"
    --redeem-url="https://< your gitea host >/login/oauth/access_token"
    --validate-url="https://< your gitea host >/api/v1"

    Email Authentication

    To authorize by email domain use --email-domain=yourcompany.com. To authorize individual email addresses use --authenticated-emails-file=/path/to/file with one email per line. To authorize all email addresses use --email-domain=*.

    Adding a new Provider

    Follow the examples in the providers package to define a new Provider instance. Add a new case to providers.New() to allow oauth2-proxy to use the -new Provider.

    Copyright © 2021 OAuth2 Proxy.
    +new Provider.

    Copyright © 2022 OAuth2 Proxy.
    - - + + - + \ No newline at end of file diff --git a/docs/next/configuration/overview/index.html b/docs/next/configuration/overview/index.html index 42a73a7c..6c24a278 100644 --- a/docs/next/configuration/overview/index.html +++ b/docs/next/configuration/overview/index.html @@ -6,8 +6,8 @@ Overview | OAuth2 Proxy - - + + @@ -41,10 +41,10 @@ Note that nginxinc/kubernetes-ingress does not include the Lua modu
    services:
    a-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.2:7555
    oauth-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.1:4180
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    oauth-errors:
    errors:
    status:
    - "401-403"
    service: oauth-backend
    query: "/oauth2/sign_in"

    ForwardAuth with static upstreams configuration

    Redirect to sign_in functionality provided without the use of errors middleware with Traefik v2 ForwardAuth middleware pointing to oauth2-proxy service's / endpoint

    Following options need to be set on oauth2-proxy:

    • --upstream=static://202: Configures a static response for authenticated sessions
    • --reverse-proxy=true: Enables the use of X-Forwarded-* headers to determine redirects correctly
    http:
    routers:
    a-service-route-1:
    rule: "Host(`a-service.example.com`, `b-service.example.com`) && PathPrefix(`/`)"
    service: a-service-backend
    middlewares:
    - oauth-auth-redirect # redirects all unauthenticated to oauth2 signin
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    a-service-route-2:
    rule: "Host(`a-service.example.com`) && PathPrefix(`/no-auto-redirect`)"
    service: a-service-backend
    middlewares:
    - oauth-auth-wo-redirect # unauthenticated session will return a 401
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    services-oauth2-route:
    rule: "Host(`a-service.example.com`, `b-service.example.com`) && PathPrefix(`/oauth2/`)"
    middlewares:
    - auth-headers
    service: oauth-backend
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    oauth2-proxy-route:
    rule: "Host(`oauth.example.com`) && PathPrefix(`/`)"
    middlewares:
    - auth-headers
    service: oauth-backend
    tls:
    certResolver: default
    domains:
    - main: "example.com"
    sans:
    - "*.example.com"
    services:
    a-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.2:7555
    b-service-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.3:7555
    oauth-backend:
    loadBalancer:
    servers:
    - url: http://172.16.0.1:4180
    -
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth-redirect:
    forwardAuth:
    address: https://oauth.example.com/
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    oauth-auth-wo-redirect:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    note

    If you set up your OAuth2 provider to rotate your client secret, you can use the client-secret-file option to reload the secret when it is updated.

    Copyright © 2021 OAuth2 Proxy.
    +
    middlewares:
    auth-headers:
    headers:
    sslRedirect: true
    stsSeconds: 315360000
    browserXssFilter: true
    contentTypeNosniff: true
    forceSTSHeader: true
    sslHost: example.com
    stsIncludeSubdomains: true
    stsPreload: true
    frameDeny: true
    oauth-auth-redirect:
    forwardAuth:
    address: https://oauth.example.com/
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    oauth-auth-wo-redirect:
    forwardAuth:
    address: https://oauth.example.com/oauth2/auth
    trustForwardHeader: true
    authResponseHeaders:
    - X-Auth-Request-Access-Token
    - Authorization
    note

    If you set up your OAuth2 provider to rotate your client secret, you can use the client-secret-file option to reload the secret when it is updated.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/next/configuration/session_storage/index.html b/docs/next/configuration/session_storage/index.html index 143eb3ff..dfdc5355 100644 --- a/docs/next/configuration/session_storage/index.html +++ b/docs/next/configuration/session_storage/index.html @@ -6,8 +6,8 @@ Session Storage | OAuth2 Proxy - - + + @@ -33,10 +33,10 @@ disclosure.

    Copyright © 2021 OAuth2 Proxy.
    +--redis-use-cluster=true flag, and configure the flags --redis-cluster-connection-urls appropriately.

    Note that flags --redis-use-sentinel=true and --redis-use-cluster=true are mutually exclusive.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/next/configuration/tls/index.html b/docs/next/configuration/tls/index.html index d8e2f74a..413005a7 100644 --- a/docs/next/configuration/tls/index.html +++ b/docs/next/configuration/tls/index.html @@ -6,8 +6,8 @@ TLS Configuration | OAuth2 Proxy - - + + @@ -24,10 +24,10 @@ external load balancer like Amazon ELB or Google Platform Load Balancing) use oauth2-proxy will then authenticate requests for an upstream application. The external endpoint for this example would be https://internal.yourcompany.com/.

    An example Nginx config follows. Note the use of Strict-Transport-Security header to pin requests to SSL via HSTS:

    server {
    listen 443 default ssl;
    server_name internal.yourcompany.com;
    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/cert.key;
    add_header Strict-Transport-Security max-age=2592000;
    -
    location / {
    proxy_pass http://127.0.0.1:4180;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_connect_timeout 1;
    proxy_send_timeout 30;
    proxy_read_timeout 30;
    }
    }

    The command line to run oauth2-proxy in this configuration would look like this:

    ./oauth2-proxy \
    --email-domain="yourcompany.com" \
    --upstream=http://127.0.0.1:8080/ \
    --cookie-secret=... \
    --cookie-secure=true \
    --provider=... \
    --reverse-proxy=true \
    --client-id=... \
    --client-secret=...
    Copyright © 2021 OAuth2 Proxy.
    +
    location / {
    proxy_pass http://127.0.0.1:4180;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_connect_timeout 1;
    proxy_send_timeout 30;
    proxy_read_timeout 30;
    }
    }

    The command line to run oauth2-proxy in this configuration would look like this:

    ./oauth2-proxy \
    --email-domain="yourcompany.com" \
    --upstream=http://127.0.0.1:8080/ \
    --cookie-secret=... \
    --cookie-secure=true \
    --provider=... \
    --reverse-proxy=true \
    --client-id=... \
    --client-secret=...
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/next/features/endpoints/index.html b/docs/next/features/endpoints/index.html index e719c3ac..0cdaa8f0 100644 --- a/docs/next/features/endpoints/index.html +++ b/docs/next/features/endpoints/index.html @@ -6,8 +6,8 @@ Endpoints | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: Next

    Endpoints

    OAuth2 Proxy responds directly to the following endpoints. All other endpoints will be proxied upstream when authenticated. The /oauth2 prefix can be changed with the --proxy-prefix config variable.

    • /robots.txt - returns a 200 OK response that disallows all User-agents from all paths; see robotstxt.org for more info
    • /ping - returns a 200 OK response, which is intended for use with health checks
    • /metrics - Metrics endpoint for Prometheus to scrape, serve on the address specified by --metrics-address, disabled by default
    • /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
    • /oauth2/sign_out - this URL is used to clear the session cookie
    • /oauth2/start - a URL that will redirect to start the OAuth cycle
    • /oauth2/callback - the URL used at the end of the OAuth cycle. The oauth app will be configured with this as the callback url.
    • /oauth2/userinfo - the URL is used to return user's email from the session in JSON format.
    • /oauth2/auth - only returns a 202 Accepted response or a 401 Unauthorized response; for use with the Nginx auth_request directive

    Sign out

    To sign the user out, redirect them to /oauth2/sign_out. This endpoint only removes oauth2-proxy's own cookies, i.e. the user is still logged in with the authentication provider and may automatically re-login when accessing the application again. You will also need to redirect the user to the authentication provider's sign out page afterwards using the rd query parameter, i.e. redirect the user to something like (notice the url-encoding!):

    /oauth2/sign_out?rd=https%3A%2F%2Fmy-oidc-provider.example.com%2Fsign_out_page

    Alternatively, include the redirect URL in the X-Auth-Request-Redirect header:

    GET /oauth2/sign_out HTTP/1.1
    X-Auth-Request-Redirect: https://my-oidc-provider/sign_out_page
    ...

    (The "sign_out_page" should be the end_session_endpoint from the metadata if your OIDC provider supports Session Management and Discovery.)

    BEWARE that the domain you want to redirect to (my-oidc-provider.example.com in the example) must be added to the --whitelist-domain configuration option otherwise the redirect will be ignored.

    Copyright © 2021 OAuth2 Proxy.
    +
    Version: Next

    Endpoints

    OAuth2 Proxy responds directly to the following endpoints. All other endpoints will be proxied upstream when authenticated. The /oauth2 prefix can be changed with the --proxy-prefix config variable.

    • /robots.txt - returns a 200 OK response that disallows all User-agents from all paths; see robotstxt.org for more info
    • /ping - returns a 200 OK response, which is intended for use with health checks
    • /metrics - Metrics endpoint for Prometheus to scrape, serve on the address specified by --metrics-address, disabled by default
    • /oauth2/sign_in - the login page, which also doubles as a sign out page (it clears cookies)
    • /oauth2/sign_out - this URL is used to clear the session cookie
    • /oauth2/start - a URL that will redirect to start the OAuth cycle
    • /oauth2/callback - the URL used at the end of the OAuth cycle. The oauth app will be configured with this as the callback url.
    • /oauth2/userinfo - the URL is used to return user's email from the session in JSON format.
    • /oauth2/auth - only returns a 202 Accepted response or a 401 Unauthorized response; for use with the Nginx auth_request directive

    Sign out

    To sign the user out, redirect them to /oauth2/sign_out. This endpoint only removes oauth2-proxy's own cookies, i.e. the user is still logged in with the authentication provider and may automatically re-login when accessing the application again. You will also need to redirect the user to the authentication provider's sign out page afterwards using the rd query parameter, i.e. redirect the user to something like (notice the url-encoding!):

    /oauth2/sign_out?rd=https%3A%2F%2Fmy-oidc-provider.example.com%2Fsign_out_page

    Alternatively, include the redirect URL in the X-Auth-Request-Redirect header:

    GET /oauth2/sign_out HTTP/1.1
    X-Auth-Request-Redirect: https://my-oidc-provider/sign_out_page
    ...

    (The "sign_out_page" should be the end_session_endpoint from the metadata if your OIDC provider supports Session Management and Discovery.)

    BEWARE that the domain you want to redirect to (my-oidc-provider.example.com in the example) must be added to the --whitelist-domain configuration option otherwise the redirect will be ignored.

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/docs/next/index.html b/docs/next/index.html index fb019b13..25c42653 100644 --- a/docs/next/index.html +++ b/docs/next/index.html @@ -6,8 +6,8 @@ Installation | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@
    -
    Version: Next

    Installation

    1. Choose how to deploy:

      a. Download Prebuilt Binary (current release is v7.2.1)

      b. Build with $ go get github.com/oauth2-proxy/oauth2-proxy/v7 which will put the binary in $GOPATH/bin

      c. Using the prebuilt docker image quay.io/oauth2-proxy/oauth2-proxy (AMD64, ARMv6 and ARM64 tags available)

      d. Using a Kubernetes manifest (Helm)

    Prebuilt binaries can be validated by extracting the file and verifying it against the sha256sum.txt checksum file provided for each release starting with version v3.0.0.

    $ sha256sum -c sha256sum.txt
    oauth2-proxy-x.y.z.linux-amd64: OK
    1. Select a Provider and Register an OAuth Application with a Provider
    2. Configure OAuth2 Proxy using config file, command line options, or environment variables
    3. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
    Copyright © 2021 OAuth2 Proxy.
    +
    Version: Next

    Installation

    1. Choose how to deploy:

      a. Download Prebuilt Binary (current release is v7.2.1)

      b. Build with $ go get github.com/oauth2-proxy/oauth2-proxy/v7 which will put the binary in $GOPATH/bin

      c. Using the prebuilt docker image quay.io/oauth2-proxy/oauth2-proxy (AMD64, ARMv6 and ARM64 tags available)

      d. Using a Kubernetes manifest (Helm)

    Prebuilt binaries can be validated by extracting the file and verifying it against the sha256sum.txt checksum file provided for each release starting with version v3.0.0.

    $ sha256sum -c sha256sum.txt
    oauth2-proxy-x.y.z.linux-amd64: OK
    1. Select a Provider and Register an OAuth Application with a Provider
    2. Configure OAuth2 Proxy using config file, command line options, or environment variables
    3. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/index.html b/index.html index 2043482f..640eaac7 100644 --- a/index.html +++ b/index.html @@ -6,8 +6,8 @@ Welcome to OAuth2 Proxy | OAuth2 Proxy - - + + @@ -18,10 +18,10 @@

    OAuth2 Proxy

    A reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others) to validate accounts by email, domain or group.

    note

    This repository was forked from bitly/OAuth2_Proxy on 27/11/2018. Versions v3.0.0 and up are from this fork and will have diverged from any changes in the original fork. -A list of changes can be seen in the CHANGELOG.

    Sign In Page

    Architecture

    OAuth2 Proxy Architecture

    Copyright © 2021 OAuth2 Proxy.
    +A list of changes can be seen in the CHANGELOG.

    Sign In Page

    Architecture

    OAuth2 Proxy Architecture

    Copyright © 2022 OAuth2 Proxy.
    - - + + diff --git a/main.b7d0cfde.js b/main.089aca77.js similarity index 99% rename from main.b7d0cfde.js rename to main.089aca77.js index 11b55730..dc154a29 100644 --- a/main.b7d0cfde.js +++ b/main.089aca77.js @@ -1,2 +1,2 @@ -/*! For license information please see main.b7d0cfde.js.LICENSE.txt */ -(window.webpackJsonp=window.webpackJsonp||[]).push([[56],[function(e,t,n){"use strict";e.exports=n(31)},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return w})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return O})),n.d(t,"e",(function(){return v})),n.d(t,"f",(function(){return L})),n.d(t,"g",(function(){return D})),n.d(t,"h",(function(){return g})),n.d(t,"i",(function(){return E})),n.d(t,"j",(function(){return C})),n.d(t,"k",(function(){return M})),n.d(t,"l",(function(){return z})),n.d(t,"m",(function(){return U})),n.d(t,"n",(function(){return $})),n.d(t,"o",(function(){return j}));var r=n(3),o=n(0),a=n.n(o),i=(n(7),n(5)),l=n(18),u=n(4),s=n(2),c=n(19),d=n.n(c),p=(n(23),n(6)),f=n(28),h=n.n(f),m=function(e){var t=Object(l.a)();return t.displayName=e,t}("Router-History"),g=function(e){var t=Object(l.a)();return t.displayName=e,t}("Router"),v=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(r.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return a.a.createElement(g.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},a.a.createElement(m.Provider,{children:this.props.children||null,value:this.props.history}))},t}(a.a.Component);var y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o=0;p--){var f=i[p];"."===f?a(i,p):".."===f?(a(i,p),d++):d&&(a(i,p),d--)}if(!s)for(;d--;d)i.unshift("..");!s||""===i[0]||i[0]&&o(i[0])||i.unshift("");var h=i.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function l(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var u=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=l(t),o=l(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},s=n(4);function c(e){return"/"===e.charAt(0)?e:"/"+e}function d(e){return"/"===e.charAt(0)?e.substr(1):e}function p(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function f(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function h(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function m(e,t,n,o){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(a=Object(r.a)({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(a.key=n),o?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=i(a.pathname,o.pathname)):a.pathname=o.pathname:a.pathname||(a.pathname="/"),a}function g(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&u(e.state,t.state)}function v(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,o):o(!0):o(!1!==a)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,o):n.push(o),d({action:r,location:o,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",o=m(e,t,p(),w.location);c.confirmTransitionTo(o,r,n,(function(e){e&&(w.entries[w.index]=o,d({action:r,location:o}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(35)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return u}));var r=n(1),o=n(2),a=n(0),i=n.n(a);function l(e,t,n){return void 0===n&&(n=[]),e.some((function(e){var o=e.path?Object(r.j)(t,e):n.length?n[n.length-1].match:r.e.computeRootMatch(t);return o&&(n.push({route:e,match:o}),e.routes&&l(e.routes,t,n)),o})),n}function u(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e?i.a.createElement(r.g,n,e.map((function(e,n){return i.a.createElement(r.d,{key:e.key||n,path:e.path,exact:e.exact,strict:e.strict,render:function(n){return e.render?e.render(Object(o.a)({},n,{},t,{route:e})):i.a.createElement(e.component,Object(o.a)({},n,t,{route:e}))}})}))):null}},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&!!window.screen};t.a=o},function(e){e.exports=JSON.parse('{"/oauth2-proxy/-4c3":{"component":"1f391b9e","content":"f3976560"},"/oauth2-proxy/docs/6.1.x-b03":{"component":"1be78505","versionMetadata":"be200c4b"},"/oauth2-proxy/docs/6.1.x/-574":{"component":"17896441","content":"7b04b1d5"},"/oauth2-proxy/docs/6.1.x/behaviour-bbe":{"component":"17896441","content":"42326c77"},"/oauth2-proxy/docs/6.1.x/community/security-9f3":{"component":"17896441","content":"ea7cbf6d"},"/oauth2-proxy/docs/6.1.x/configuration/oauth_provider-a82":{"component":"17896441","content":"3def9002"},"/oauth2-proxy/docs/6.1.x/configuration/overview-e4e":{"component":"17896441","content":"ade45c9a"},"/oauth2-proxy/docs/6.1.x/configuration/session_storage-2f9":{"component":"17896441","content":"f5839aac"},"/oauth2-proxy/docs/6.1.x/configuration/tls-ece":{"component":"17896441","content":"a37c03cb"},"/oauth2-proxy/docs/6.1.x/features/endpoints-c39":{"component":"17896441","content":"a991188b"},"/oauth2-proxy/docs/6.1.x/features/request_signatures-d6c":{"component":"17896441","content":"6f497b56"},"/oauth2-proxy/docs/7.0.x-07a":{"component":"1be78505","versionMetadata":"230aeb34"},"/oauth2-proxy/docs/7.0.x/-49f":{"component":"17896441","content":"0721a2c0"},"/oauth2-proxy/docs/7.0.x/behaviour-4fc":{"component":"17896441","content":"5a047177"},"/oauth2-proxy/docs/7.0.x/community/security-384":{"component":"17896441","content":"f4c9d322"},"/oauth2-proxy/docs/7.0.x/configuration/alpha-config-3d9":{"component":"17896441","content":"3fa022c7"},"/oauth2-proxy/docs/7.0.x/configuration/oauth_provider-72d":{"component":"17896441","content":"7dcecc8d"},"/oauth2-proxy/docs/7.0.x/configuration/overview-e27":{"component":"17896441","content":"8c826f25"},"/oauth2-proxy/docs/7.0.x/configuration/session_storage-0fb":{"component":"17896441","content":"edfc6e1b"},"/oauth2-proxy/docs/7.0.x/configuration/tls-0e4":{"component":"17896441","content":"00691219"},"/oauth2-proxy/docs/7.0.x/features/endpoints-ee1":{"component":"17896441","content":"001ca130"},"/oauth2-proxy/docs/7.0.x/features/request_signatures-5f5":{"component":"17896441","content":"b89e1cb0"},"/oauth2-proxy/docs/7.1.x-e6c":{"component":"1be78505","versionMetadata":"cecf159a"},"/oauth2-proxy/docs/7.1.x/-1c0":{"component":"17896441","content":"63d69a63"},"/oauth2-proxy/docs/7.1.x/behaviour-371":{"component":"17896441","content":"41de83de"},"/oauth2-proxy/docs/7.1.x/community/security-c12":{"component":"17896441","content":"300a9996"},"/oauth2-proxy/docs/7.1.x/configuration/alpha-config-dbe":{"component":"17896441","content":"243cbd97"},"/oauth2-proxy/docs/7.1.x/configuration/oauth_provider-d79":{"component":"17896441","content":"cbc8963c"},"/oauth2-proxy/docs/7.1.x/configuration/overview-24b":{"component":"17896441","content":"92147208"},"/oauth2-proxy/docs/7.1.x/configuration/session_storage-a0e":{"component":"17896441","content":"1999cd7b"},"/oauth2-proxy/docs/7.1.x/configuration/tls-8a7":{"component":"17896441","content":"de718920"},"/oauth2-proxy/docs/7.1.x/features/endpoints-02f":{"component":"17896441","content":"f98fc388"},"/oauth2-proxy/docs/next-434":{"component":"1be78505","versionMetadata":"935f2afb"},"/oauth2-proxy/docs/next/-9e9":{"component":"17896441","content":"3b8c55ea"},"/oauth2-proxy/docs/next/behaviour-8be":{"component":"17896441","content":"94285305"},"/oauth2-proxy/docs/next/community/security-166":{"component":"17896441","content":"35234f08"},"/oauth2-proxy/docs/next/configuration/alpha-config-85d":{"component":"17896441","content":"cd4a49c1"},"/oauth2-proxy/docs/next/configuration/oauth_provider-2fc":{"component":"17896441","content":"357fe94d"},"/oauth2-proxy/docs/next/configuration/overview-613":{"component":"17896441","content":"0f425520"},"/oauth2-proxy/docs/next/configuration/session_storage-683":{"component":"17896441","content":"9f61b932"},"/oauth2-proxy/docs/next/configuration/tls-2d0":{"component":"17896441","content":"585bdad0"},"/oauth2-proxy/docs/next/features/endpoints-e4a":{"component":"17896441","content":"efc9be4b"},"/oauth2-proxy/docs-fcf":{"component":"1be78505","versionMetadata":"e8c74efb"},"/oauth2-proxy/docs/-b11":{"component":"17896441","content":"9ac82b89"},"/oauth2-proxy/docs/behaviour-6bb":{"component":"17896441","content":"adcdd4d2"},"/oauth2-proxy/docs/community/security-2d6":{"component":"17896441","content":"3b8e2d60"},"/oauth2-proxy/docs/configuration/alpha-config-d46":{"component":"17896441","content":"7874e99f"},"/oauth2-proxy/docs/configuration/oauth_provider-353":{"component":"17896441","content":"a1bbfb14"},"/oauth2-proxy/docs/configuration/overview-1fb":{"component":"17896441","content":"76aee1e9"},"/oauth2-proxy/docs/configuration/session_storage-10f":{"component":"17896441","content":"ecc333f0"},"/oauth2-proxy/docs/configuration/tls-da4":{"component":"17896441","content":"9b9cfcc1"},"/oauth2-proxy/docs/features/endpoints-1a3":{"component":"17896441","content":"fb908f49"}}')},function(e,t,n){"use strict";t.a={title:"OAuth2 Proxy",tagline:"A lightweight authentication proxy written in Go",url:"https://oauth2-proxy.github.io",baseUrl:"/oauth2-proxy/",onBrokenLinks:"throw",favicon:"img/logos/OAuth2_Proxy_icon.svg",organizationName:"oauth2-proxy",projectName:"oauth2-proxy",themeConfig:{navbar:{title:"OAuth2 Proxy",logo:{alt:"OAuth2 Proxy",src:"img/logos/OAuth2_Proxy_icon.svg"},items:[{to:"docs/",activeBasePath:"docs",label:"Docs",position:"left"},{type:"docsVersionDropdown",position:"right",dropdownActiveClassDisabled:!0,dropdownItemsBefore:[],dropdownItemsAfter:[]},{href:"https://github.com/oauth2-proxy/oauth2-proxy",label:"GitHub",position:"right"}],hideOnScroll:!1},footer:{style:"dark",copyright:"Copyright \xa9 2021 OAuth2 Proxy.",links:[]},colorMode:{defaultMode:"light",disableSwitch:!1,respectPrefersColorScheme:!1,switchConfig:{darkIcon:"\ud83c\udf1c",darkIconStyle:{},lightIcon:"\ud83c\udf1e",lightIconStyle:{}}},docs:{versionPersistence:"localStorage"},metadatas:[],prism:{additionalLanguages:[]}},presets:[["@docusaurus/preset-classic",{docs:{sidebarPath:"/home/runner/work/oauth2-proxy/oauth2-proxy/docs/sidebars.js",editUrl:"https://github.com/oauth2-proxy/oauth2-proxy/edit/master/docs/"},theme:{customCss:"/home/runner/work/oauth2-proxy/oauth2-proxy/docs/src/css/custom.css"}}]],onDuplicateRoutes:"warn",customFields:{},plugins:[],themes:[],titleDelimiter:"|",noIndex:!1}},function(e,t,n){var r,o;void 0===(o="function"==typeof(r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
    '};function o(e,t,n){return en?n:e}function a(e){return 100*(-1+e)}function i(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+a(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+a(e)+"%,0)"}:{"margin-left":a(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),s=a.querySelector(r.barSelector),c=r.speed,d=r.easing;return a.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),u(s,i(e,c,d)),1===e?(u(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){u(a,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,i=t.querySelector(r.barSelector),l=e?"-100":a(n.status||0),s=document.querySelector(r.parent);return u(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&f(o),s!=document.body&&c(s,"nprogress-custom-parent"),s.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&f(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),u=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,a=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+a)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,o[1],o[2])}}();function s(e,t){return("string"==typeof e?e:p(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=p(e),r=n+t;s(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=p(e);s(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function p(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function f(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n})?r.call(t,n,t,e):r)||(e.exports=o)},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return y})),n.d(t,"e",(function(){return x}));var r=n(1);n.d(t,"d",(function(){return r.a})),n.d(t,"f",(function(){return r.b})),n.d(t,"g",(function(){return r.c})),n.d(t,"h",(function(){return r.d})),n.d(t,"i",(function(){return r.e})),n.d(t,"j",(function(){return r.f})),n.d(t,"k",(function(){return r.g})),n.d(t,"l",(function(){return r.i})),n.d(t,"m",(function(){return r.j})),n.d(t,"n",(function(){return r.k})),n.d(t,"o",(function(){return r.l})),n.d(t,"p",(function(){return r.m})),n.d(t,"q",(function(){return r.n})),n.d(t,"r",(function(){return r.o}));var o=n(3),a=n(0),i=n.n(a),l=n(5),u=(n(7),n(2)),s=n(6),c=n(4),d=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oe.length)return;if(!(x instanceof u)){if(m&&b!=t.length-1){if(p.lastIndex=w,!(C=p.exec(e)))break;for(var k=C.index+(h?C[1].length:0),E=C.index+C[0].length,S=b,T=w,_=t.length;S<_&&(T=(T+=t[S].length)&&(++b,w=T);if(t[b]instanceof u)continue;O=S-b,x=e.slice(w,T),C.index-=w}else{p.lastIndex=0;var C=p.exec(x),O=1}if(C){h&&(g=C[1]?C[1].length:0),E=(k=C.index+g)+(C=C[0].slice(g)).length;var P=x.slice(0,k),R=x.slice(E),A=[b,O];P&&(++b,w+=P.length,A.push(P));var N=new u(s,f?o.tokenize(C,f):C,v,C,m);if(A.push(N),R&&A.push(R),Array.prototype.splice.apply(t,A),1!=O&&o.matchGrammar(e,t,n,b,w,!0,s),i)break}else if(i)break}}}}},hooks:{add:function(){}},tokenize:function(e,t,n){var r=[e],a=t.rest;if(a){for(var i in a)t[i]=a[i];delete t.rest}return o.matchGrammar(e,r,t,0,0,!1),r}},(a=o.Token=function(e,t,n,r,o){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!o}).stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===o.util.type(e))return e.map((function(n){return a.stringify(n,t,e)})).join("");var r={type:e.type,content:a.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if(e.alias){var i="Array"===o.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(r.classes,i)}var l=Object.keys(r.attributes).map((function(e){return e+'="'+(r.attributes[e]||"").replace(/"/g,""")+'"'})).join(" ");return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+(l?" "+l:"")+">"+r.content+""},o);i.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},i.languages.markup.tag.inside["attr-value"].inside.entity=i.languages.markup.entity,i.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(i.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:i.languages[t]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:i.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[\s\S]*?>)(?:\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g,e),"i"),lookbehind:!0,greedy:!0,inside:r},i.languages.insertBefore("markup","cdata",o)}}),i.languages.xml=i.languages.extend("markup",{}),i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)\w+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b\w+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+?)\s*(?:\r?\n|\r)(?:[\s\S])*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s*(?:\r?\n|\r)(?:[\s\S])*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0},{pattern:/(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\1)[^\\])*\1/,greedy:!0,inside:n}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|==?|!=?|=~|<<[<-]?|[&\d]?>>|\d?[<>]&?|&[>&]?|\|[&|]?|<=?|>=?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}};for(var r=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=n.variable[1].inside,a=0;a=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},i.languages.c=i.languages.extend("clike",{"class-name":{pattern:/(\b(?:enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/,number:/(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete i.languages.c.boolean,i.languages.cpp=i.languages.extend("c",{"class-name":{pattern:/(\b(?:class|enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i,greedy:!0},operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:true|false)\b/}),i.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/@[\w-]+/}},url:{pattern:RegExp("url\\((?:"+t.source+"|[^\n\r()]*)\\)","i"),inside:{function:/^url/i,punctuation:/^\(|\)$/}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+t.source+")*?(?=\\s*\\{)"),string:{pattern:t,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:n.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:e.languages.css}},alias:"language-css"}},n.tag))}(i),i.languages.css.selector={pattern:i.languages.css.selector,inside:{"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-:.\w]+/,id:/#[-:.\w]+/,attribute:{pattern:/\[(?:[^[\]"']|("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1)*\]/,greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)[-*\w\xA0-\uFFFF]*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},attribute:{pattern:/^(\s*)[-\w\xA0-\uFFFF]+/,lookbehind:!0},value:[/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,{pattern:/(=\s*)[-\w\xA0-\uFFFF]+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],punctuation:/[()]/}},i.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*/i,lookbehind:!0}}),i.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:/#[\da-f]{3,8}/i,entity:/\\[\da-f]{1,8}/i,unit:{pattern:/(\d)(?:%|[a-z]+)/,lookbehind:!0},number:/-?[\d.]+/}),i.languages.javascript=i.languages.extend("clike",{"class-name":[i.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),i.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,i.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:i.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:i.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:i.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:i.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),i.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.markup.tag.addInlined("script","javascript"),i.languages.js=i.languages.javascript,function(e){var t=e.util.clone(e.languages.javascript);e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=/<\/?(?:[\w.:-]+\s*(?:\s+(?:[\w.:-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s{'">=]+|\{(?:\{(?:\{[^}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\}))*\s*\/?)?>/i,e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/i,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">]+)/i,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.insertBefore("inside","attr-name",{spread:{pattern:/\{\.{3}[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\}/,inside:{punctuation:/\.{3}|[{}.]/,"attr-value":/\w+/}}},e.languages.jsx.tag),e.languages.insertBefore("inside","attr-value",{script:{pattern:/=(\{(?:\{(?:\{[^}]*\}|[^}])*\}|[^}])+\})/i,inside:{"script-punctuation":{pattern:/^=(?={)/,alias:"punctuation"},rest:e.languages.jsx},alias:"language-javascript"}},e.languages.jsx.tag);var n=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(n).join(""):""},r=function(t){for(var o=[],a=0;a0&&o[o.length-1].tagName===n(i.content[0].content[1])&&o.pop():"/>"===i.content[i.content.length-1].content||o.push({tagName:n(i.content[0].content[1]),openedBraces:0}):o.length>0&&"punctuation"===i.type&&"{"===i.content?o[o.length-1].openedBraces++:o.length>0&&o[o.length-1].openedBraces>0&&"punctuation"===i.type&&"}"===i.content?o[o.length-1].openedBraces--:l=!0),(l||"string"==typeof i)&&o.length>0&&0===o[o.length-1].openedBraces){var u=n(i);a0&&("string"==typeof t[a-1]||"plain-text"===t[a-1].type)&&(u=n(t[a-1])+u,t.splice(a-1,1),a--),t[a]=new e.Token("plain-text",u,null,u)}i.content&&"string"!=typeof i.content&&r(i.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||r(e.tokens)}))}(i),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^\s*(?:\/{3}|\*|\/\*\*)\s*@(?:param|arg|arguments)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^\s*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(t,n){"string"==typeof t&&(t=[t]),t.forEach((function(t){!function(t,n){var r="doc-comment",o=e.languages[t];if(o){var a=o[r];if(!a){var i={"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,alias:"comment"}};a=(o=e.languages.insertBefore(t,"comment",i))[r]}if(a instanceof RegExp&&(a=o[r]={pattern:a}),Array.isArray(a))for(var l=0,u=a.length;l>>?=?|->|([-+&|])\2|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","class-name",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0},namespace:{pattern:/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(\.[a-z]\w*)+/,lookbehind:!0,inside:{punctuation:/\./}},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":n,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})}(i),function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,a){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof a&&!a(e))return e;for(var o,l=i.length;-1!==n.code.indexOf(o=t(r,l));)++l;return i[l]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,a=Object.keys(n.tokenStack);!function i(l){for(var u=0;u=a.length);u++){var s=l[u];if("string"==typeof s||s.content&&"string"==typeof s.content){var c=a[o],d=n.tokenStack[c],p="string"==typeof s?s:s.content,f=t(r,c),h=p.indexOf(f);if(h>-1){++o;var m=p.substring(0,h),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),v=p.substring(h+f.length),y=[];m&&y.push.apply(y,i([m])),y.push(g),v&&y.push.apply(y,i([v])),"string"==typeof s?l.splice.apply(l,[u,1].concat(y)):s.content=y}}else s.content&&i(s.content)}return l}(n.tokens)}}}})}(i),function(e){e.languages.php=e.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,boolean:{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),e.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),e.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),e.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),e.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var t={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/,lookbehind:!0,inside:{rest:e.languages.php}};e.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:t}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:t}}}),delete e.languages.php.string,e.hooks.add("before-tokenize",(function(t){if(/<\?/.test(t.code)){e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(i),function(e){var t=e.languages.javascript,n=/{(?:[^{}]|{(?:[^{}]|{[^{}]*})*})+}/.source,r="(@(?:param|arg|argument|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/[$\w\xA0-\uFFFF.]+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[[$\w\xA0-\uFFFF.]+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{punctuation:/[.,:?=<>|{}()[\]]/}},{pattern:/(@(?:augments|extends|class|interface|memberof!?|this)\s+)[A-Z]\w*(?:\.[A-Z]\w*)*/,lookbehind:!0,inside:{punctuation:/\./}}],example:{pattern:/(@example\s+)[^@]+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^(\s*(?:\*\s*)?).+$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(i),i.languages.actionscript=i.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),i.languages.actionscript["class-name"].alias="function",i.languages.markup&&i.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:{rest:i.languages.markup}}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},rest:e.languages.javascript}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(i),function(e){e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:(?:Uint|Int)(?:8|16|32)|Uint8Clamped|Float(?:32|64))?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|(?:Weak)?(?:Set|Map)|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:/(\.\s*)#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*/,lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|location|navigator|performance|(?:local|session)Storage|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var t=["function","function-variable","method","method-variable","property-access"],n=0;n))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:type|opaque|declare|Class)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:await|Diff|Exact|Keys|ObjMap|PropertyType|Shape|Record|Supertype|Subtype|Enum)\b(?!\$)/,lookbehind:!0})}(i),i.languages.n4js=i.languages.extend("javascript",{keyword:/\b(?:any|Array|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),i.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),i.languages.n4jsd=i.languages.n4js,i.languages.typescript=i.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),i.languages.ts=i.languages.typescript,function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,o=r.inside["interpolation-punctuation"],a=r.pattern.source;function i(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function l(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function u(t,n,r){var o={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",o),o.tokens=e.tokenize(o.code,o.grammar),e.hooks.run("after-tokenize",o),o.tokens}function s(t){var n={};n["interpolation-punctuation"]=o;var a=e.tokenize(t,n);if(3===a.length){var i=[1,1];i.push.apply(i,u(a[1],e.languages.javascript,"javascript")),a.splice.apply(a,i)}return new e.Token("interpolation",a,r.alias,t)}function c(t,n,r){var o=e.tokenize(t,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),i=0,c={},d=u(o.map((function(e){if("string"==typeof e)return e;for(var n,o=e.content;-1!==t.indexOf(n=l(i++,r)););return c[n]=o,n})).join(""),n,r),p=Object.keys(c);return i=0,function e(t){for(var n=0;n=p.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var o=p[i],a="string"==typeof r?r:r.content,l=a.indexOf(o);if(-1!==l){++i;var u=a.substring(0,l),d=s(c[o]),f=a.substring(l+o.length),h=[];if(u&&h.push(u),h.push(d),f){var m=[f];e(m),h.push.apply(h,m)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(h)),n+=h.length-1):r.content=h}}else{var g=r.content;Array.isArray(g)?e(g):e([g])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[i("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),i("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),i("svg",/\bsvg/.source),i("markdown",/\b(?:md|markdown)/.source),i("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function p(e){return"string"==typeof e?e:Array.isArray(e)?e.map(p).join(""):p(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,o=n.length;r/g,t),n&&(e=e+"|"+e.replace(/_/g,"\\*")),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``.+?``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\r?\n|\r)|$)/.source.replace(/__/g,r),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\r?\n|\r)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+a+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+a+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/(^[ \t]*(?:\r?\n|\r))(?: {4}|\t).+(?:(?:\r?\n|\r)(?: {4}|\t).+)*/m,lookbehind:!0,alias:"keyword"},{pattern:/``.+?``|`[^`\r\n]+`/,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\r?\n|\r))[\s\S]+?(?=(?:\r?\n|\r)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\r?\n|\r)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#+.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/__(?:(?!_)|_(?:(?!_))+_)+__/.source,!0),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/_(?:(?!_)|__(?:(?!_))+__)+_/.source,!0),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+?\2/.source,!1),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[(?:(?!\]))+\])/.source,!1),lookbehind:!0,greedy:!0,inside:{variable:{pattern:/(\[)[^\]]+(?=\]$)/,lookbehind:!0},content:{pattern:/(^!?\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},string:{pattern:/"(?:\\.|[^"\\])*"(?=\)$)/}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),"diff"===n&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:o}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(i),i.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/m}},coord:/^@@.*@@$/m,commit_sha1:/^commit \w{40}$/m},i.languages.go=i.languages.extend("clike",{keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,builtin:/\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/,boolean:/\b(?:_|iota|nil|true|false)\b/,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,number:/(?:\b0x[a-f\d]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[-+]?\d+)?)i?/i,string:{pattern:/(["'`])(\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0}}),delete i.languages.go["class-name"],function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:true|false)\b/,block:{pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")}))}(i),i.languages.json={property:{pattern:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,number:/-?\d+\.?\d*(e[+-]?\d+)?/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},i.languages.less=i.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-]+?(?:\([^{}]+\)|[^(){};])*?(?=\s*\{)/i,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{};@])*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,operator:/[+\-*\/]/}),i.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/,lookbehind:!0,alias:"function"}}),i.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,symbol:{pattern:/^[^:=\r\n]+(?=\s*:(?!=))/m,inside:{variable:/\$+(?:[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:[/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,{pattern:/(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/,lookbehind:!0}],operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},i.languages.objectivec=i.languages.extend("c",{keyword:/\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,string:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete i.languages.objectivec["class-name"],i.languages.ocaml={comment:/\(\*[\s\S]*?\*\)/,string:[{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},{pattern:/(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i,greedy:!0}],number:/\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]?[\d_]+)?)/i,type:{pattern:/\B['`]\w*/,alias:"variable"},directive:{pattern:/\B#\w+/,alias:"function"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|object|of|open|prefix|private|rec|then|sig|struct|to|try|type|val|value|virtual|where|while|with)\b/,boolean:/\b(?:false|true)\b/,operator:/:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lxor|lsl|lsr|mod|nor|or)\b/,punctuation:/[(){}\[\]|_.,:;]/},i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^\s*)@\w+(?:\.\w+)*/i,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},i.languages.python["string-interpolation"].inside.interpolation.inside.rest=i.languages.python,i.languages.py=i.languages.python,i.languages.reason=i.languages.extend("clike",{comment:{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:mod|land|lor|lxor|lsl|lsr|asr)\b/}),i.languages.insertBefore("reason","class-name",{character:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,alias:"string"},constructor:{pattern:/\b[A-Z]\w*\b(?!\s*\.)/,alias:"variable"},label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete i.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t]+.+)*/m,lookbehind:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,inside:{atrule:/(?:@[\w-]+|[+=])/m}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|or|not)\b/,{pattern:/(\s+)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s]+.*)/m,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/([ \t]*)\S(?:,?[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,?[^,\r\n]+)*)*/,lookbehind:!0}})}(i),i.languages.scss=i.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()]|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}]+[:{][^}]+))/m,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[\w-]|\$[-\w]+|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),i.languages.insertBefore("scss","atrule",{keyword:[/@(?:if|else(?: if)?|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)/i,{pattern:/( +)(?:from|through)(?= )/,lookbehind:!0}]}),i.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),i.languages.insertBefore("scss","function",{placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,lookbehind:!0}}),i.languages.scss.atrule.inside.rest=i.languages.scss,i.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURNS?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b0x[\da-f]+\b|\b\d+\.?\d*|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t={url:/url\((["']?).*?\1\)/i,string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:if|else|for|return|unless)(?=\s+|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,number:/\b\d+(?:\.\d+)?%?/,boolean:/\b(?:true|false)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.+|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],punctuation:/[{}()\[\];:,]/};t.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^{|}$/,alias:"punctuation"},rest:t}},t.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:t}},e.languages.stylus={comment:{pattern:/(^|[^\\])(\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},"atrule-declaration":{pattern:/(^\s*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:t}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:(?:\{[^}]*\}|.+)|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:t}},statement:{pattern:/(^[ \t]*)(?:if|else|for|return|unless)[ \t]+.+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:t}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)[^{\r\n]*(?:;|[^{\r\n,](?=$)(?!(\r?\n|\r)(?:\{|\2[ \t]+)))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:t.interpolation}},rest:t}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t]+)))/m,lookbehind:!0,inside:{interpolation:t.interpolation,punctuation:/[{},]/}},func:t.func,string:t.string,interpolation:t.interpolation,punctuation:/[{}()\[\];:.]/}}(i);var l=i.util.clone(i.languages.typescript);i.languages.tsx=i.languages.extend("jsx",l),i.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^_`|~]+/i,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/},i.languages.yaml={scalar:{pattern:/([\-:]\s*(?:![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\2[^\r\n]+)*)/,lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:/(\s*(?:^|[:\-,[{\r\n?])[ \t]*(?:![^\s]+)?[ \t]*)[^\r\n{[\]},#\s]+?(?=\s*:\s)/,lookbehind:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?)(?=[ \t]*(?:$|,|]|}))/m,lookbehind:!0,alias:"number"},boolean:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:true|false)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},null:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:null|~)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},string:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)("|')(?:(?!\2)[^\\\r\n]|\\.)*\2(?=[ \t]*(?:$|,|]|}|\s*#))/m,lookbehind:!0,greedy:!0},number:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+\.?\d*|\.?\d+)(?:e[+-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,lookbehind:!0},tag:/![^\s]+/,important:/[&*][\w]+/,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},i.languages.yml=i.languages.yaml,t.a=i},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,l,u=i(e),s=1;sR.length&&R.push(e)}function I(e,t,n,r){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case a:case i:l=!0}}if(l)return n(r,e,""===t?"."+D(e,0):t),1;if(l=0,t=""===t?".":t+":",Array.isArray(e))for(var u=0;u