---
title: Keycloak Realm
slug: homologacao-atmosphere/keycloak-realm
description: Learn how to add, update, and remove realms using the keycloak_auth_options module with this comprehensive documentation. Explore the various parameters such as realm name, display name, login theme, admin theme, email theme, and more. Discover the extens
createdAt: 2021-10-26T12:14:03.000Z
---

## Resumo

Adiciona/atualiza/remove realm

## Parâmetros

Extende a documentação do módulo keycloak\_auth\_options

| Parâmetro                          | Tipo | Escolhas \| Valor Padrão   | Comentários                                                                 |
| ---------------------------------- | ---- | -------------------------- | --------------------------------------------------------------------------- |
| realm - *required*                 | str  |                            | Nome do realm a ser criado                                                  |
| displayName                        | str  |                            | Display name do realm                                                       |
| displayNameHtml                    | str  |                            | Nome que será utilizado no html                                             |
| loginTheme                         | str  |                            | Tema de login                                                               |
| adminTheme                         | str  |                            | Tema do console de admin                                                    |
| emailTheme                         | str  |                            | Tema para os emails do realm                                                |
| accountTheme                       | str  |                            | Tema para as contas do realm                                                |
| internationalizationEnabled        | bool |                            | Habilita/desabilita internacionalização                                     |
| supportedLocales                   | list |                            | Lista de línguas suportadas no realm                                        |
| defaultLocale                      | str  |                            | Se múltiplas línguas forem suportadas, qual deve ser selecionada por padrão |
| accessCodeLifespan                 | int  |                            | Access code lifespan                                                        |
| accessCodeLifespanLogin            | int  |                            | Access code lifespan login                                                  |
| accessCodeLifespanUserAction       | int  |                            | Access code lifespan for user action                                        |
| accessTokenLifespan                | int  |                            | Acces token lifespan                                                        |
| accessTokenLifespanForImplicitFlow | int  |                            | Access token lifespan for implicit flow                                     |
| notBefore                          | int  |                            | Not Before                                                                  |
| revokeRefreshToken                 | bool |                            | Revoke refresh token                                                        |
| ssoSessionMaxLifespan              | int  |                            | SSO Session Max Lifespan                                                    |
| offlineSessionIdleTimeout          | int  |                            | Offline Session Idle Timeout                                                |
| ssoSessionIdleTimeout              | int  |                            | SSO sessio idle timeout                                                     |
| enabled                            | bool |                            | Habilita/Desabilita realm                                                   |
| sslRequired                        | str  | default: external          | Se SSL is required                                                          |
| registrationAllowed                | bool |                            | Se registrar-se está habilitado                                             |
| registrationEmailAsUsername        | bool |                            | Habilita/desabilita registrar email como username                           |
| rememberMe                         | bool |                            | Permite usuário continuar logado                                            |
| verifyEmail                        | bool |                            | Força usuário a verificar email                                             |
| loginWithEmailAllowed              | bool |                            | Habilita/desabilita login com email                                         |
| duplicateEmailsAllowed             | bool |                            | Habilita/desabilita registrar email em mais de uma conta                    |
| resetPasswordAllowed               | bool |                            | Habilita/desabilita resetar senha                                           |
| editUsernameAllowed                | bool |                            | Habilita/desabilita alterar username                                        |
| bruteForceProtected                | bool |                            | Habilita/desabilita proteção de ataques de força bruta                      |
| permanentLockout                   | bool |                            | Habilita/desabilita permanent lockout                                       |
| maxFailureWaitSeconds              | int  |                            | Max Failure Wait Seconds                                                    |
| minimumQuickLoginWaitSeconds       | int  |                            | Minimum Quick Login Wait Seconds                                            |
| waitIncrementSeconds               | int  |                            | Wait Increment Seconds                                                      |
| quickLoginCheckMilliSeconds        | int  |                            | Quick Login Check Mili Seconds                                              |
| maxDeltaTimeSeconds                | int  |                            | Max Delta Time Seconds                                                      |
| failureFactor                      | int  |                            | Failure Factor                                                              |
| defaultRoles                       | list |                            | Default Roles                                                               |
| requiredCredentials                | list |                            | Required Credentials                                                        |
| passwordPolicy                     | dict |                            | Password policy definition                                                  |
| otpPolicyType                      | str  | default: totp              | Política de OTP                                                             |
| otpPolicyAlgorithm                 | str  | default: HmacSHA1          | Algorítmo utilizado no OTP                                                  |
| otpPolicyInitialCounter            | int  | default: 0                 | Contador Inicial do OTP                                                     |
| otpPolicyDigits                    | int  | default: 6                 | Número de dígitos do OTP                                                    |
| otpPolicyLookAheadWindow           | int  | default: 1                 | OTP Look Ahead WIndow                                                       |
| otpPolicyPeriod                    | int  | default: 30                | OTP Policy Period                                                           |
| smtpServer                         | dict |                            | SMTP server configuration                                                   |
| eventsConfig                       | dict |                            | Event configuration for realm                                               |
| browserFlow                        | str  | default: browser           |                                                                             |
| registrationFlow                   | str  | default: registration      |                                                                             |
| directGrantFlow                    | str  | default: direct grant      |                                                                             |
| resetCredentialsFlow               | str  | default: reset credentials |                                                                             |
| clientAuthenticationFlow           | str  | default: clients           |                                                                             |
| attributes                         | dict |                            |                                                                             |
| browserSecurityHeaders             | dict |                            |                                                                             |
| state                              | str  | present<br />absent        |                                                                             |
| force                              | bool |                            | If true, removes realm then recreate it                                     |

## Subcampos da opção passwordPolicy

| Parâmetros                 | Tipo | Escolhas \| Valor Padrão | Comentários                                                     |
| -------------------------- | ---- | ------------------------ | --------------------------------------------------------------- |
| digits                     |      | int                      | Quantidade mínima de números                                    |
| forceExpiredPasswordChange |      | int                      |                                                                 |
| hashAlgorithm              | str  | pbkdf2-sha256            | Algoritmo de Hash, pbkdf2-sha256 é o único suportado atualmente |
| hashInteration             | int  |                          | Número de interações                                            |
| length                     | int  |                          | Tamanho mínimo da senha                                         |
| lowerCase                  | int  |                          | Quantidade mínima de letras caixa baixa                         |
| maxLength                  | int  |                          | Tamanho máximo da senha                                         |
| notEmail                   | bool |                          | Nega senhas iguais ao email                                     |
| notUsername                | bool |                          | Nega senhas iguais ao username                                  |
| regexPattern               | str  |                          | Senha tem que passar pela validação da regex                    |
| specialChars               | int  |                          | Quantidade mínima de caracteres especiais                       |
| upperCase                  | int  |                          | Quantidade mínima de letras caixa alta                          |

## Subcampos da opção smtpServer

| Parâmetros | Tipo | Escolhas \| Valor Padrão | Comentários |
| ---------- | ---- | ------------------------ | ----------- |
|            |      |                          |             |
|            |      |                          |             |
|            |      |                          |             |

## Subcampos da opção eventsConfig

| Parâmetros | Tipo | Escolhas \| Valor Padrão | Comentários |
| ---------- | ---- | ------------------------ | ----------- |
|            |      |                          |             |
|            |      |                          |             |
|            |      |                          |             |

## Valores Retornados

| Parâmetros   | Tipo | Retornado quando | Comentários                     |
| ------------ | ---- | ---------------- | ------------------------------- |
| realm        | dict | on success       | Realm definition on JSON        |
| eventsConfig | dict | on success       | Events configuration for realm  |
| msg          | str  | on error         | Error message, if occured       |
| changed      | bool | always           | If realm definition has changed |

