> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/engineering-reference/db/tables/sso_rules.md).

# sso\_rules

{% hint style="info" %}
Generated from the staging database schema, with descriptions drafted by agents ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/db/tables/sso_rules.md).
{% endhint %}

## Description

One rule that recommends a sign-in method for login emails containing email\_tail, and can add users who sign in that way to groups.

<details>

<summary><strong>Table Definition</strong></summary>

```sql
CREATE TABLE `sso_rules` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) DEFAULT NULL,
  `fStartTs` bigint DEFAULT '0',
  `fEndTs` bigint DEFAULT NULL,
  `enum_sso` varchar(255) DEFAULT NULL,
  `email_tail` varchar(255) DEFAULT NULL,
  `pattern_json` json DEFAULT NULL,
  `position` int DEFAULT '1000',
  `comment` varchar(255) DEFAULT NULL,
  `group_json` json DEFAULT NULL,
  `fDeleted` tinyint DEFAULT '0',
  `fCreatedTs` bigint DEFAULT '0',
  `fModifiedTs` bigint DEFAULT '0',
  `fServerTs` bigint DEFAULT NULL,
  `uuid_tUser_CreatedBy` varchar(255) DEFAULT NULL,
  `uuid_tUser_ModifiedBy` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uuid` (`uuid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1
```

</details>

## Columns

| Name                    | Type         | Default | Nullable | Extra Definition | Comment                                                                                                                                                                                 |
| ----------------------- | ------------ | ------- | -------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                      | int          |         | false    | auto\_increment  |                                                                                                                                                                                         |
| uuid                    | varchar(255) |         | true     |                  |                                                                                                                                                                                         |
| fStartTs                | bigint       | 0       | true     |                  | Start of the rule's time window; sign-in does not check it \[[ASK-248](https://github.com/snapfix/docs/blob/main/ASK.md#ask-248-should-the-sso_rules-dates-limit-when-a-rule-applies)]. |
| fEndTs                  | bigint       |         | true     |                  | End of the rule's time window; sign-in does not check it \[[ASK-248](https://github.com/snapfix/docs/blob/main/ASK.md#ask-248-should-the-sso_rules-dates-limit-when-a-rule-applies)].   |
| enum\_sso               | varchar(255) |         | true     |                  | google, azure, apple, github, amazon, slack, snapfix-password, snapfix-email-otp or snapfix-mobile-otp.                                                                                 |
| email\_tail             | varchar(255) |         | true     |                  | Text matched anywhere in the login email (SQL LOCATE); matching rules sort by where it is found, then by position.                                                                      |
| pattern\_json           | json         |         | true     |                  | JSON conditions: sso\_exclude 1 hides the method from the recommendations, and for Google, keys matched against the user's Google profile.                                              |
| position                | int          | 1000    | true     |                  | Order among matching rules; lower first.                                                                                                                                                |
| comment                 | varchar(255) |         | true     |                  |                                                                                                                                                                                         |
| group\_json             | json         |         | true     |                  | JSON list of groups (group, userbusiness\_template) that a user signing in with this method joins.                                                                                      |
| fDeleted                | tinyint      | 0       | true     |                  |                                                                                                                                                                                         |
| fCreatedTs              | bigint       | 0       | true     |                  |                                                                                                                                                                                         |
| fModifiedTs             | bigint       | 0       | true     |                  |                                                                                                                                                                                         |
| fServerTs               | bigint       |         | true     |                  |                                                                                                                                                                                         |
| uuid\_tUser\_CreatedBy  | varchar(255) |         | true     |                  |                                                                                                                                                                                         |
| uuid\_tUser\_ModifiedBy | varchar(255) |         | true     |                  |                                                                                                                                                                                         |

## Viewpoints

| Name                                                                               | Definition                                                                                                                                                          |
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [account](https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-0.md) | Signing in, passwords, verification codes, devices and sign-in tokens, single sign-on, app start and consent logs, and the links that open the app (dynamic links). |

## Constraints

| Name    | Type        | Definition             |
| ------- | ----------- | ---------------------- |
| PRIMARY | PRIMARY KEY | PRIMARY KEY (id)       |
| uuid    | UNIQUE      | UNIQUE KEY uuid (uuid) |

## Indexes

| Name    | Definition                         |
| ------- | ---------------------------------- |
| PRIMARY | PRIMARY KEY (id) USING BTREE       |
| uuid    | UNIQUE KEY uuid (uuid) USING BTREE |

## Relations

```mermaid
erDiagram


"sso_rules" {
  int id PK
}
```

***

> Generated by [tbls](https://github.com/k1LoW/tbls)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/engineering-reference/db/tables/sso_rules.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
