<titledata-react-helmet="true">OAuth Provider Configuration | OAuth2 Proxy</title><metadata-react-helmet="true"name="twitter:card"content="summary_large_image"><metadata-react-helmet="true"name="docusaurus_language"content="en"><metadata-react-helmet="true"name="docusaurus_version"content="6.1.x"><metadata-react-helmet="true"name="docusaurus_tag"content="docs-default-6.1.x"><metadata-react-helmet="true"property="og:title"content="OAuth Provider Configuration | OAuth2 Proxy"><metadata-react-helmet="true"name="description"content="You will need to register an OAuth application with a Provider (Google, GitHub or another provider), and configure it with Redirect URI(s) for the domain you intend to run oauth2-proxy on."><metadata-react-helmet="true"property="og:description"content="You will need to register an OAuth application with a Provider (Google, GitHub or another provider), and configure it with Redirect URI(s) for the domain you intend to run oauth2-proxy on."><metadata-react-helmet="true"property="og:url"content="https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/oauth_provider"><linkdata-react-helmet="true"rel="shortcut icon"href="/oauth2-proxy/img/logos/OAuth2_Proxy_icon.svg"><linkdata-react-helmet="true"rel="canonical"href="https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/oauth_provider"><linkrel="stylesheet"href="/oauth2-proxy/styles.58710d0f.css">
and the user will be checked against all the provided groups.</li><li>Lock down the permissions on the json file downloaded from step 1 so only oauth2-proxy is able to read the file and set the path to the file in the <code>google-service-account-json</code> flag.</li><li>Restart oauth2-proxy.</li></ol><p>Note: The user is checked against the group members list on initial authentication and every time the token is refreshed ( about once an hour ).</p><h3><aaria-hidden="true"tabindex="-1"class="anchor enhancedAnchor_2cZh"id="azure-auth-provider"></a>Azure Auth Provider<aaria-hidden="true"tabindex="-1"class="hash-link"href="#azure-auth-provider"title="Direct link to heading">#</a></h3><ol><li>Add an application: go to <ahref="https://portal.azure.com"target="_blank"rel="noopener noreferrer">https://portal.azure.com</a>, choose <strong>"Azure Active Directory"</strong> in the left menu, select <strong>"App registrations"</strong> and then click on <strong>"New app registration"</strong>.</li><li>Pick a name and choose <strong>"Webapp / API"</strong> as application type. Use <code>https://internal.yourcompany.com</code> as Sign-on URL. Click <strong>"Create"</strong>.</li><li>On the <strong>"Settings"</strong> / <strong>"Properties"</strong> page of the app, pick a logo and select <strong>"Multi-tenanted"</strong> if you want to allow users from multiple organizations to access your app. Note down the application ID. Click <strong>"Save"</strong>.</li><li>On the <strong>"Settings"</strong> / <strong>"Required Permissions"</strong> page of the app, click on <strong>"Windows Azure Active Directory"</strong> and then on <strong>"Access the directory as the signed in user"</strong>. Hit <strong>"Save"</strong> and then then on <strong>"Grant permissions"</strong> (you might need another admin to do this).</li><li>On the <strong>"Settings"</strong> / <strong>"Reply URLs"</strong> page of the app, add <code>https://internal.yourcompanycom/oauth2/callback</code> for each host that you want to protect by the oauth2 proxy. Click <strong>"Save"</strong>.</li><li>On the <strong>"Settings"</strong> / <strong>"Keys"</strong> page of the app, add a new key and note down the value after hitting <strong>"Save"</strong>.</li><li>Configure the proxy with</li></ol><divclass="mdxCodeBlock_1XEh"><divclass="codeBlockContent_1u-d"><buttontabindex="0"type="button"aria-label="Copy code to clipboard"class="copyButton_10dd">Copy</button><divclass="prism-code language-undefined codeBlock_3iAC"><divclass="codeBlockLines_b7E3"style="color:#bfc7d5;background-color:#292d3e"><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> --provider=azure</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> --client-id=<application ID from step 3></span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> --client-secret=<value from step 6></span></div></div></div></div></div><p>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 <ahref="/oauth2-proxy/docs/configuration/session_storage#redis-storage">redis session storage</a> should resolve this.</p><h3><aaria-hidden="true"tabindex="-1"class="anchor enhancedAnchor_2cZh"id="facebook-auth-provider"></a>Facebook Auth Provider<aaria-hidden="true"tabindex="-1"class="hash-link"href="#facebook-auth-provider"title="Direct link to heading">#</a></h3><ol><li>Create a new FB App from <ahref="https://developers.facebook.com/"target="_blank"rel="noopener noreferrer">https://developers.facebook.com/</a></li><li>Under FB Login, set your Valid OAuth redirect URIs to <code>https://internal.yourcompany.com/oauth2/callback</code></
the following steps:</p><h4><aaria-hidden="true"tabindex="-1"class="anchor enhancedAnchor_2cZh"id="configuring-the-oidc-provider-with-okta"></a>Configuring the OIDC Provider with Okta<aaria-hidden="true"tabindex="-1"class="hash-link"href="#configuring-the-oidc-provider-with-okta"title="Direct link to heading">#</a></h4><ol><li>Log in to Okta using an administrative account. It is suggested you try this in preview first, <code>example.oktapreview.com</code></li><li>(OPTIONAL) If you want to configure authorization scopes and claims to be passed on to multiple applications,
you may wish to configure an authorization server for each application. Otherwise, the provided <code>default</code> will work.</li></ol><ul><li>Navigate to <strong>Security</strong> then select <strong>API</strong></li><li>Click <strong>Add Authorization Server</strong>, if this option is not available you may require an additional license for a custom authorization server.</li><li>Fill out the <strong>Name</strong> with something to describe the application you are protecting. e.g. 'Example App'.</li><li>For <strong>Audience</strong>, pick the URL of the application you wish to protect: <ahref="https://example.corp.com"target="_blank"rel="noopener noreferrer">https://example.corp.com</a></li><li>Fill out a <strong>Description</strong></li><li>Add any <strong>Access Policies</strong> you wish to configure to limit application access.</li><li>The default settings will work for other options.
<ahref="https://developer.okta.com/docs/guides/customize-authz-server/overview/"target="_blank"rel="noopener noreferrer">See Okta documentation for more information on Authorization Servers</a></li></ul><olstart="3"><li>Navigate to <strong>Applications</strong> then select <strong>Add Application</strong>.</li></ol><ul><li>Select <strong>Web</strong> for the <strong>Platform</strong> setting.</li><li>Select <strong>OpenID Connect</strong> and click <strong>Create</strong></li><li>Pick an <strong>Application Name</strong> such as <code>Example App</code>.</li><li>Set the <strong>Login redirect URI</strong> to <code>https://example.corp.com</code>.</li><li>Under <strong>General</strong> set the <strong>Allowed grant types</strong> to <code>Authorization Code</code> and <code>Refresh Token</code>.</li><li>Leave the rest as default, taking note of the <code>Client ID</code> and <code>Client Secret</code>.</li><li>Under <strong>Assignments</strong> select the users or groups you wish to access your application.</li></ul><olstart="4"><li>Create a configuration file like the following:</li></ol><divclass="mdxCodeBlock_1XEh"><divclass="codeBlockContent_1u-d"><buttontabindex="0"type="button"aria-label="Copy code to clipboard"class="copyButton_10dd">Copy</button><divclass="prism-code language-undefined codeBlock_3iAC"><divclass="codeBlockLines_b7E3"style="color:#bfc7d5;background-color:#292d3e"><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">provider = "oidc"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">redirect_url = "https://example.corp.com/oauth2/callback"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">oidc_issuer_url = "https://corp.okta.com/oauth2/abCd1234"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">upstreams = [</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">"https://example.corp.com"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">]</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">email_domains = [</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">"corp.com"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">]</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">client_id = "XXXXX"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">client_secret = "YYYYY"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">pass_access_token = true</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">cookie_secret = "ZZZZZ"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">skip_provider_button = true</span></div></div></div></div></div><p>The <code>oidc_issuer_url</code> is based on URL from your <strong>Authorization Server</strong>'s <strong>Issuer</strong> field in step 2, or simply <ahref="https://corp.okta.com"target="_blank"rel="noopener noreferrer">https://corp.okta.com</a>
The <code>client_id</code> and <code>client_secret</code> are configured in the application settings.
Generate a unique <code>client_secret</code> to encrypt the cookie.</p><p>Then you can start the oauth2-proxy with <code>./oauth2-proxy --config /etc/example.cfg</code></p><h4><aaria-hidden="true"tabindex="-1"class="anchor enhancedAnchor_2cZh"id="configuring-the-oidc-provider-with-okta---localhost"></a>Configuring the OIDC Provider with Okta - localhost<aaria-hidden="true"tabindex="-1"class="hash-link"href="#configuring-the-oidc-provider-with-okta---localhost"title="Direct link to heading">#</a></h4><ol><li>Signup for developer account: <ahref="https://developer.okta.com/signup/"target="_blank"rel="noopener noreferrer">https://developer.okta.com/signup/</a></li><li>Create New <code>Web</code> Application: https://${your-okta-domain}/dev/console/apps/new</li><li>Example Application Settings for localhost:<ul><li><strong>Name:</strong> My Web App</li><li><strong>Base URIs:</strong> http://localhost:4180/</li><li><strong>Login redirect URIs:</strong> http://localhost:4180/oauth2/callback</li><li><strong>Logout redirect URIs:</strong> http://localhost:4180/</li><li><strong>Group assignments:</strong><code>Everyone</code></li><li><strong>Grant type allowed:</strong><code>Authorization Code</code> and <code>Refresh Token</code></li></ul></li><li>Make note of the <code>Client ID</code> and <code>Client secret</code>, they are needed in a future step</li><li>Make note of the <strong>default</strong> Authorization Server Issuer URI from: https://${your-okta-domain}/admin/oauth2/as</li><li>Example config file <code>/etc/localhost.cfg</code><divclass="mdxCodeBlock_1XEh"><divclass="codeBlockContent_1u-d"><buttontabindex="0"type="button"aria-label="Copy code to clipboard"class="copyButton_10dd">Copy</button><divclass="prism-code language-undefined codeBlock_3iAC"><divclass="codeBlockLines_b7E3"style="color:#bfc7d5;background-color:#292d3e"><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">provider = "oidc"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">redirect_url = "http://localhost:4180/oauth2/callback"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">oidc_issuer_url = "https://${your-okta-domain}/oauth2/default"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">upstreams = [</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">"http://0.0.0.0:8080"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">]</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">email_domains = [</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">"*"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">]</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">client_id = "XXX"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">client_secret = "YYY"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">pass_access_token = true</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">cookie_secret = "ZZZ"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">cookie_secure = false</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">skip_provider_button = true</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"># Note: use the following for testing within a container</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"># http_address = "0.0.0.0:4180"</span></div></div></div></div></div></li><li>Then you can start the oauth2-proxy with <code>./oauth2-proxy --config /etc/localhost.cfg</code></li></ol><h3><aaria-hidden="true"tabindex="-1"class="anchor enhancedAnchor_2cZh"id="logingov-provider"></a>login.gov Provider<aa
If you are a US Government agency, you can contact the login.gov team through the contact information
that you can find on <ahref="https://login.gov/developers/"target="_blank"rel="noopener noreferrer">https://login.gov/developers/</a> and work with them to understand how to get login.gov
accounts for integration/test and production access.</p><p>A developer guide is available here: <ahref="https://developers.login.gov/"target="_blank"rel="noopener noreferrer">https://developers.login.gov/</a>, though this proxy handles everything
but the data you need to create to register your application in the login.gov dashboard.</p><p>As a demo, we will assume that you are running your application that you want to secure locally on
http://localhost:3000/, that you will be starting your proxy up on http://localhost:4180/, and that
you have an agency integration account for testing.</p><p>First, register your application in the dashboard. The important bits are:</p><ul><li>Identity protocol: make this <code>Openid connect</code></li><li>Issuer: do what they say for OpenID Connect. We will refer to this string as <code>${LOGINGOV_ISSUER}</code>.</li><li>Public key: This is a self-signed certificate in .pem format generated from a 2048 bit RSA private key.
A quick way to do this is <code>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'</code>,
The contents of the <code>key.pem</code> shall be referred to as <code>${OAUTH2_PROXY_JWT_KEY}</code>.</li><li>Return to App URL: Make this be <code>http://localhost:4180/</code></li><li>Redirect URIs: Make this be <code>http://localhost:4180/oauth2/callback</code>.</li><li>Attribute Bundle: Make sure that email is selected.</li></ul><p>Now start the proxy up with the following options:</p><divclass="mdxCodeBlock_1XEh"><divclass="codeBlockContent_1u-d"><buttontabindex="0"type="button"aria-label="Copy code to clipboard"class="copyButton_10dd">Copy</button><divclass="prism-code language-undefined codeBlock_3iAC"><divclass="codeBlockLines_b7E3"style="color:#bfc7d5;background-color:#292d3e"><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain">./oauth2-proxy -provider login.gov \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -client-id=${LOGINGOV_ISSUER} \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -redirect-url=http://localhost:4180/oauth2/callback \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -oidc-issuer-url=https://idp.int.identitysandbox.gov/ \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -cookie-secure=false \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -email-domain=gsa.gov \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -upstream=http://localhost:3000/ \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -cookie-secret=somerandomstring12341234567890AB \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -cookie-domain=localhost \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -skip-provider-button=true \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -pubjwk-url=https://idp.int.identitysandbox.gov/api/openid_connect/certs \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -profile-url=https://idp.int.identitysandbox.gov/api/openid_connect/userinfo \</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -jwt-key="${OAUTH2_PROXY_JWT_KEY}"</span></div></div></div></div></div><p>You can also set all these options with environment variables, for use in cloud/docker environments.
One tricky thing that you may encounter is that some cloud environments will pass in environment
variables in a docker env-file, which does not allow multiline variables like a PEM file.
If you encounter this, then you can create a <code>jwt_signing_key.pem</code> file in the top level
directory of the repo which contains the key in PEM format and then do your docker build.
The docker build process will copy that file into your image which you can then access by
setting the <code>OAUTH2_PROXY_JWT_KEY_FILE=/etc/ssl/private/jwt_signing_key.pem</code>
environment variable, or by setting <code>--jwt-key-file=/etc/ssl/private/jwt_signing_key.pem</code> on the commandline.</p><p>Once it is running, you should be able to go to <code>http://localhost:4180/</code> in your browser,
get authenticated by the login.gov integration server, and then get proxied on to your
application running on <code>http://localhost:3000/</code>. In a real deployment, you would secure
your application with a firewall or something so that it was only accessible from the
proxy, and you would use real hostnames everywhere.</p><h4><aaria-hidden="true"tabindex="-1"class="anchor enhancedAnchor_2cZh"id="skip-oidc-discovery"></a>Skip OIDC discovery<aaria-hidden="true"tabindex="-1"class="hash-link"href="#skip-oidc-discovery"title="Direct link to heading">#</a></h4><p>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.</p><p>In this case, you can set the <code>--skip-oidc-discovery</code> option, and supply those required endpoints manually:</p><divclass="mdxCodeBlock_1XEh"><divclass="codeBlockContent_1u-d"><buttontabindex="0"type="button"aria-label="Copy code to clipboard"class="copyButton_10dd">Copy</button><divclass="prism-code language-undefined codeBlock_3iAC"><divclass="codeBlockLines_b7E3"style="color:#bfc7d5;background-color:#292d3e"><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -provider oidc</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -client-id oauth2-proxy</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -client-secret proxy</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -redirect-url http://127.0.0.1:4180/oauth2/callback</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -oidc-issuer-url http://127.0.0.1:5556</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -skip-oidc-discovery</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -login-url http://127.0.0.1:5556/authorize</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -redeem-url http://127.0.0.1:5556/token</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -oidc-jwks-url http://127.0.0.1:5556/keys</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -cookie-secure=false</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -email-domain example.com</span></div></div></div></div></div><h3><aaria-hidden="true"tabindex="-1"class="anchor enhancedAnchor_2cZh"id="nextcloud-provider"></a>Nextcloud Provider<aaria-hidden="true"tabindex="-1"class="hash-link"href="#nextcloud-provider"title="Direct link to heading">#</a></h3><p>The Nextcloud provider allows you to authenticate against users in your
Nextcloud instance.</p><p>When you are using the Nextcloud provider, you must specify the urls via
configuration, environment variable, or command line argument. Depending
on whether your Nextcloud instance is using pretty urls your urls may be of the
form <code>/index.php/apps/oauth2/*</code> or <code>/apps/oauth2/*</code>.</p><p>Refer to the <ahref="https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/oauth2.html"target="_blank"rel="noopener noreferrer">OAuth2
documentation</a>
to setup the client id and client secret. Your "Redirection URI" will be
<code>https://internalapp.yourcompany.com/oauth2/callback</code>.</p><divclass="mdxCodeBlock_1XEh"><divclass="codeBlockContent_1u-d"><buttontabindex="0"type="button"aria-label="Copy code to clipboard"class="copyButton_10dd">Copy</button><divclass="prism-code language-undefined codeBlock_3iAC"><divclass="codeBlockLines_b7E3"style="color:#bfc7d5;background-color:#292d3e"><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -provider nextcloud</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -client-id <from nextcloud admin></span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -client-secret <from nextcloud admin></span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -login-url="<your nextcloud url>/index.php/apps/oauth2/authorize"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -redeem-url="<your nextcloud url>/index.php/apps/oauth2/api/v1/token"</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> -validate-url="<your nextcloud url>/ocs/v2.php/cloud/user?format=json"</span></div></div></div></div></div><p>Note: in <em>all</em> cases the validate-url will <em>not</em> have the <code>index.php</code>.</p><h3><aaria-hidden="true"tabindex="-1"class="anchor enhancedAnchor_2cZh"id="digitalocean-auth-provider"></a>DigitalOcean Auth Provider<aaria-hidden="true"tabindex="-1"class="hash-link"href="#digitalocean-auth-provider"title="Direct link to heading">#</a></h3><ol><li><ahref="https://cloud.digitalocean.com/account/api/applications"target="_blank"rel="noopener noreferrer">Create a new OAuth application</a><ul><li>You can fill in the name, homepage, and description however you wish.</li><li>In the "Application callback URL" field, enter: <code>https://oauth-proxy/oauth2/callback</code>, substituting <code>oauth2-proxy</code> with the actual hostname that oauth2-proxy is running on. The URL must match oauth2-proxy's configured redirect URL.</li></ul></li><li>Note the Client ID and Client Secret.</li></ol><p>To use the provider, pass the following options:</p><divclass="mdxCodeBlock_1XEh"><divclass="codeBlockContent_1u-d"><buttontabindex="0"type="button"aria-label="Copy code to clipboard"class="copyButton_10dd">Copy</button><divclass="prism-code language-undefined codeBlock_3iAC"><divclass="codeBlockLines_b7E3"style="color:#bfc7d5;background-color:#292d3e"><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> --provider=digitalocean</span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> --client-id=<Client ID></span></div><divclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> --client-secret=<Client Secret></span></div></div></div></div></div><p> Alternatively, set the equivalent options in the config file. The redirect URL defaults to <code>https://<requested host header>/oauth2/callback</code>. If you need to change it, you can use the <code>--redirect-url</code> command-line option.</p><h3><aaria-hidden="true"tabindex="-1"class="anchor enhancedAnchor_2cZh"id="bitbucket-auth-provider"></a>Bitbucket Auth Provider<aaria-hidden="true"tabindex="-1"class="hash-link"href="#bitbucket-auth-provider"title="Direct link to heading">#</a></h3><ol><li><ahref="https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html"target="_blank"rel="noopener noreferrer">Add a new OAuth consumer</a><ul><li>In "Callback URL" use <code>https://<oauth2-proxy>/oauth2/callback</code>, substituting <code><oauth2-proxy></code> with the actual hostname that oauth2-proxy is running on.</li><li>In Permissions section select:<ul><li>Account -> Email</li><li>Team membership -> Read</li><li>Repositories -> Read</li></ul></li></ul></li><li>Note the Client ID and Client Secret.</li></ol><p>To use the provider
<code>Provider</code> instance. Add a new <code>case</code> to
<ahref="https://github.com/oauth2-proxy/oauth2-proxy/blob/master/providers/providers.go"target="_blank"rel="noopener noreferrer"><code>providers.New()</code></a> to allow <code>oauth2-proxy</code> to use the