# OAuth

Grey Matter’s sidecar proxy supports full OAuth 2.0 negotiation.

## Filter Configuration Options

| Name              | Type    | Default | Description                                                                                                                                                                                                                                                                                                                             |
| ----------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `provider`        | String  | ""      | The url for the OpenID connect provider to use. This is used to determine the particular OAuth endpoints.                                                                                                                                                                                                                               |
| `client_id`       | String  | ""      | The public identifier registered with the OAuth authorization server.                                                                                                                                                                                                                                                                   |
| `client_secret`   | String  | ""      | The secret known only to the application and the authorization server.                                                                                                                                                                                                                                                                  |
| `server_name`     | String  | ""      | The host name of the application. When a user signs in through the OAuth provider, they will need to be redirected back to your application; this host name will be used during the redirect.                                                                                                                                           |
| `server_insecure` | Boolean | false   | Setting this to `true` specifies that you're application is *not* protected by TLS; the redirect URL will then use `http` as the scheme instead of `https`. NOTE: this should *only* be used for development, and with test users for which you don't mind leaking access: OAuth credentials will be sent un-encrypted over plain HTTP. |
| `session_secret`  | String  | ""      | The secret known only to the application. This will be used to cryptographically sign the user's session cookie.                                                                                                                                                                                                                        |
| `domain`          | String  | ""      | A regex describing the expected email domain(s) for authorized users. If this regex pattern does not match, the attempted login is forbidden.                                                                                                                                                                                           |

### Example

```yaml
http_filters:
- name: gm.oauth
  config:
    provider: https://accounts.google.com
    client_id: 234q2348uads8f9sdafds.apps.googleusercontent.com
    client_secret: secret
    server_name: oauth.yoursite.com
    server_insecure:  false
    session_secret: secret2
    domain: gmail.com
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://greymatter.gitbook.io/grey-matter-documentation/usage/fabric/filters/http/gm-oauth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
