# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities

__all__ = ['GithubIdentityProviderArgs', 'GithubIdentityProvider']

@pulumi.input_type
class GithubIdentityProviderArgs:
    def __init__(__self__, *,
                 client_id: pulumi.Input[_builtins.str],
                 client_secret: pulumi.Input[_builtins.str],
                 realm: pulumi.Input[_builtins.str],
                 add_read_token_role_on_create: Optional[pulumi.Input[_builtins.bool]] = None,
                 alias: Optional[pulumi.Input[_builtins.str]] = None,
                 api_url: Optional[pulumi.Input[_builtins.str]] = None,
                 authenticate_by_default: Optional[pulumi.Input[_builtins.bool]] = None,
                 base_url: Optional[pulumi.Input[_builtins.str]] = None,
                 default_scopes: Optional[pulumi.Input[_builtins.str]] = None,
                 display_name: Optional[pulumi.Input[_builtins.str]] = None,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 extra_config: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 first_broker_login_flow_alias: Optional[pulumi.Input[_builtins.str]] = None,
                 github_json_format: Optional[pulumi.Input[_builtins.bool]] = None,
                 gui_order: Optional[pulumi.Input[_builtins.str]] = None,
                 hide_on_login_page: Optional[pulumi.Input[_builtins.bool]] = None,
                 link_only: Optional[pulumi.Input[_builtins.bool]] = None,
                 org_domain: Optional[pulumi.Input[_builtins.str]] = None,
                 org_redirect_mode_email_matches: Optional[pulumi.Input[_builtins.bool]] = None,
                 organization_id: Optional[pulumi.Input[_builtins.str]] = None,
                 post_broker_login_flow_alias: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_id: Optional[pulumi.Input[_builtins.str]] = None,
                 store_token: Optional[pulumi.Input[_builtins.bool]] = None,
                 sync_mode: Optional[pulumi.Input[_builtins.str]] = None,
                 trust_email: Optional[pulumi.Input[_builtins.bool]] = None):
        """
        The set of arguments for constructing a GithubIdentityProvider resource.
        :param pulumi.Input[_builtins.str] client_id: The client or client identifier registered within the identity provider.
        :param pulumi.Input[_builtins.str] client_secret: The client or client secret registered within the identity provider. This field is able to obtain its value from vault, use $${vault.ID} format.
        :param pulumi.Input[_builtins.str] realm: The name of the realm. This is unique across Keycloak.
        :param pulumi.Input[_builtins.bool] add_read_token_role_on_create: When `true`, new users will be able to read stored tokens. This will automatically assign the `broker.read-token` role. Defaults to `false`.
        :param pulumi.Input[_builtins.str] alias: The alias for the GitHub identity provider.
        :param pulumi.Input[_builtins.str] api_url: The GitHub API URL, defaults to `https://api.github.com`.
        :param pulumi.Input[_builtins.bool] authenticate_by_default: Enable/disable authenticate users by default.
        :param pulumi.Input[_builtins.str] base_url: The GitHub base URL, defaults to `https://github.com`
        :param pulumi.Input[_builtins.str] default_scopes: The scopes to be sent when asking for authorization. It can be a space-separated list of scopes. Defaults to `user:email`.
        :param pulumi.Input[_builtins.str] display_name: Display name for the GitHub identity provider in the GUI.
        :param pulumi.Input[_builtins.bool] enabled: When `true`, users will be able to log in to this realm using this identity provider. Defaults to `true`.
        :param pulumi.Input[_builtins.str] first_broker_login_flow_alias: The authentication flow to use when users log in for the first time through this identity provider. Defaults to `first broker login`.
        :param pulumi.Input[_builtins.bool] github_json_format: When `true`, GitHub API is told explicitly to accept JSON during token authentication requests. Defaults to `false`.
        :param pulumi.Input[_builtins.str] gui_order: A number defining the order of this identity provider in the GUI.
        :param pulumi.Input[_builtins.bool] hide_on_login_page: When `true`, this identity provider will be hidden on the login page. Defaults to `false`.
        :param pulumi.Input[_builtins.bool] link_only: When `true`, users cannot sign-in using this provider, but their existing accounts will be linked when possible. Defaults to `false`.
        :param pulumi.Input[_builtins.str] organization_id: ID of organization with which this identity is linked.
        :param pulumi.Input[_builtins.str] post_broker_login_flow_alias: The authentication flow to use after users have successfully logged in, which can be used to perform additional user verification (such as OTP checking). Defaults to an empty string, which means no post login flow will be used.
        :param pulumi.Input[_builtins.str] provider_id: The ID of the identity provider to use. Defaults to `github`, which should be used unless you have extended Keycloak and provided your own implementation.
        :param pulumi.Input[_builtins.bool] store_token: When `true`, tokens will be stored after authenticating users. Defaults to `true`.
        :param pulumi.Input[_builtins.str] sync_mode: The default sync mode to use for all mappers attached to this identity provider. Can be once of `IMPORT`, `FORCE`, or `LEGACY`.
        :param pulumi.Input[_builtins.bool] trust_email: When `true`, email addresses for users in this provider will automatically be verified regardless of the realm's email verification policy. Defaults to `false`.
        """
        pulumi.set(__self__, "client_id", client_id)
        pulumi.set(__self__, "client_secret", client_secret)
        pulumi.set(__self__, "realm", realm)
        if add_read_token_role_on_create is not None:
            pulumi.set(__self__, "add_read_token_role_on_create", add_read_token_role_on_create)
        if alias is not None:
            pulumi.set(__self__, "alias", alias)
        if api_url is not None:
            pulumi.set(__self__, "api_url", api_url)
        if authenticate_by_default is not None:
            pulumi.set(__self__, "authenticate_by_default", authenticate_by_default)
        if base_url is not None:
            pulumi.set(__self__, "base_url", base_url)
        if default_scopes is not None:
            pulumi.set(__self__, "default_scopes", default_scopes)
        if display_name is not None:
            pulumi.set(__self__, "display_name", display_name)
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if extra_config is not None:
            pulumi.set(__self__, "extra_config", extra_config)
        if first_broker_login_flow_alias is not None:
            pulumi.set(__self__, "first_broker_login_flow_alias", first_broker_login_flow_alias)
        if github_json_format is not None:
            pulumi.set(__self__, "github_json_format", github_json_format)
        if gui_order is not None:
            pulumi.set(__self__, "gui_order", gui_order)
        if hide_on_login_page is not None:
            pulumi.set(__self__, "hide_on_login_page", hide_on_login_page)
        if link_only is not None:
            pulumi.set(__self__, "link_only", link_only)
        if org_domain is not None:
            pulumi.set(__self__, "org_domain", org_domain)
        if org_redirect_mode_email_matches is not None:
            pulumi.set(__self__, "org_redirect_mode_email_matches", org_redirect_mode_email_matches)
        if organization_id is not None:
            pulumi.set(__self__, "organization_id", organization_id)
        if post_broker_login_flow_alias is not None:
            pulumi.set(__self__, "post_broker_login_flow_alias", post_broker_login_flow_alias)
        if provider_id is not None:
            pulumi.set(__self__, "provider_id", provider_id)
        if store_token is not None:
            pulumi.set(__self__, "store_token", store_token)
        if sync_mode is not None:
            pulumi.set(__self__, "sync_mode", sync_mode)
        if trust_email is not None:
            pulumi.set(__self__, "trust_email", trust_email)

    @_builtins.property
    @pulumi.getter(name="clientId")
    def client_id(self) -> pulumi.Input[_builtins.str]:
        """
        The client or client identifier registered within the identity provider.
        """
        return pulumi.get(self, "client_id")

    @client_id.setter
    def client_id(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "client_id", value)

    @_builtins.property
    @pulumi.getter(name="clientSecret")
    def client_secret(self) -> pulumi.Input[_builtins.str]:
        """
        The client or client secret registered within the identity provider. This field is able to obtain its value from vault, use $${vault.ID} format.
        """
        return pulumi.get(self, "client_secret")

    @client_secret.setter
    def client_secret(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "client_secret", value)

    @_builtins.property
    @pulumi.getter
    def realm(self) -> pulumi.Input[_builtins.str]:
        """
        The name of the realm. This is unique across Keycloak.
        """
        return pulumi.get(self, "realm")

    @realm.setter
    def realm(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "realm", value)

    @_builtins.property
    @pulumi.getter(name="addReadTokenRoleOnCreate")
    def add_read_token_role_on_create(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, new users will be able to read stored tokens. This will automatically assign the `broker.read-token` role. Defaults to `false`.
        """
        return pulumi.get(self, "add_read_token_role_on_create")

    @add_read_token_role_on_create.setter
    def add_read_token_role_on_create(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "add_read_token_role_on_create", value)

    @_builtins.property
    @pulumi.getter
    def alias(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The alias for the GitHub identity provider.
        """
        return pulumi.get(self, "alias")

    @alias.setter
    def alias(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "alias", value)

    @_builtins.property
    @pulumi.getter(name="apiUrl")
    def api_url(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The GitHub API URL, defaults to `https://api.github.com`.
        """
        return pulumi.get(self, "api_url")

    @api_url.setter
    def api_url(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "api_url", value)

    @_builtins.property
    @pulumi.getter(name="authenticateByDefault")
    def authenticate_by_default(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Enable/disable authenticate users by default.
        """
        return pulumi.get(self, "authenticate_by_default")

    @authenticate_by_default.setter
    def authenticate_by_default(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "authenticate_by_default", value)

    @_builtins.property
    @pulumi.getter(name="baseUrl")
    def base_url(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The GitHub base URL, defaults to `https://github.com`
        """
        return pulumi.get(self, "base_url")

    @base_url.setter
    def base_url(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "base_url", value)

    @_builtins.property
    @pulumi.getter(name="defaultScopes")
    def default_scopes(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The scopes to be sent when asking for authorization. It can be a space-separated list of scopes. Defaults to `user:email`.
        """
        return pulumi.get(self, "default_scopes")

    @default_scopes.setter
    def default_scopes(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "default_scopes", value)

    @_builtins.property
    @pulumi.getter(name="displayName")
    def display_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Display name for the GitHub identity provider in the GUI.
        """
        return pulumi.get(self, "display_name")

    @display_name.setter
    def display_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "display_name", value)

    @_builtins.property
    @pulumi.getter
    def enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, users will be able to log in to this realm using this identity provider. Defaults to `true`.
        """
        return pulumi.get(self, "enabled")

    @enabled.setter
    def enabled(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "enabled", value)

    @_builtins.property
    @pulumi.getter(name="extraConfig")
    def extra_config(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]:
        return pulumi.get(self, "extra_config")

    @extra_config.setter
    def extra_config(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]):
        pulumi.set(self, "extra_config", value)

    @_builtins.property
    @pulumi.getter(name="firstBrokerLoginFlowAlias")
    def first_broker_login_flow_alias(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The authentication flow to use when users log in for the first time through this identity provider. Defaults to `first broker login`.
        """
        return pulumi.get(self, "first_broker_login_flow_alias")

    @first_broker_login_flow_alias.setter
    def first_broker_login_flow_alias(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "first_broker_login_flow_alias", value)

    @_builtins.property
    @pulumi.getter(name="githubJsonFormat")
    def github_json_format(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, GitHub API is told explicitly to accept JSON during token authentication requests. Defaults to `false`.
        """
        return pulumi.get(self, "github_json_format")

    @github_json_format.setter
    def github_json_format(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "github_json_format", value)

    @_builtins.property
    @pulumi.getter(name="guiOrder")
    def gui_order(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        A number defining the order of this identity provider in the GUI.
        """
        return pulumi.get(self, "gui_order")

    @gui_order.setter
    def gui_order(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "gui_order", value)

    @_builtins.property
    @pulumi.getter(name="hideOnLoginPage")
    def hide_on_login_page(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, this identity provider will be hidden on the login page. Defaults to `false`.
        """
        return pulumi.get(self, "hide_on_login_page")

    @hide_on_login_page.setter
    def hide_on_login_page(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "hide_on_login_page", value)

    @_builtins.property
    @pulumi.getter(name="linkOnly")
    def link_only(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, users cannot sign-in using this provider, but their existing accounts will be linked when possible. Defaults to `false`.
        """
        return pulumi.get(self, "link_only")

    @link_only.setter
    def link_only(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "link_only", value)

    @_builtins.property
    @pulumi.getter(name="orgDomain")
    def org_domain(self) -> Optional[pulumi.Input[_builtins.str]]:
        return pulumi.get(self, "org_domain")

    @org_domain.setter
    def org_domain(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "org_domain", value)

    @_builtins.property
    @pulumi.getter(name="orgRedirectModeEmailMatches")
    def org_redirect_mode_email_matches(self) -> Optional[pulumi.Input[_builtins.bool]]:
        return pulumi.get(self, "org_redirect_mode_email_matches")

    @org_redirect_mode_email_matches.setter
    def org_redirect_mode_email_matches(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "org_redirect_mode_email_matches", value)

    @_builtins.property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        ID of organization with which this identity is linked.
        """
        return pulumi.get(self, "organization_id")

    @organization_id.setter
    def organization_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "organization_id", value)

    @_builtins.property
    @pulumi.getter(name="postBrokerLoginFlowAlias")
    def post_broker_login_flow_alias(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The authentication flow to use after users have successfully logged in, which can be used to perform additional user verification (such as OTP checking). Defaults to an empty string, which means no post login flow will be used.
        """
        return pulumi.get(self, "post_broker_login_flow_alias")

    @post_broker_login_flow_alias.setter
    def post_broker_login_flow_alias(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "post_broker_login_flow_alias", value)

    @_builtins.property
    @pulumi.getter(name="providerId")
    def provider_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the identity provider to use. Defaults to `github`, which should be used unless you have extended Keycloak and provided your own implementation.
        """
        return pulumi.get(self, "provider_id")

    @provider_id.setter
    def provider_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "provider_id", value)

    @_builtins.property
    @pulumi.getter(name="storeToken")
    def store_token(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, tokens will be stored after authenticating users. Defaults to `true`.
        """
        return pulumi.get(self, "store_token")

    @store_token.setter
    def store_token(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "store_token", value)

    @_builtins.property
    @pulumi.getter(name="syncMode")
    def sync_mode(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The default sync mode to use for all mappers attached to this identity provider. Can be once of `IMPORT`, `FORCE`, or `LEGACY`.
        """
        return pulumi.get(self, "sync_mode")

    @sync_mode.setter
    def sync_mode(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "sync_mode", value)

    @_builtins.property
    @pulumi.getter(name="trustEmail")
    def trust_email(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, email addresses for users in this provider will automatically be verified regardless of the realm's email verification policy. Defaults to `false`.
        """
        return pulumi.get(self, "trust_email")

    @trust_email.setter
    def trust_email(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "trust_email", value)


@pulumi.input_type
class _GithubIdentityProviderState:
    def __init__(__self__, *,
                 add_read_token_role_on_create: Optional[pulumi.Input[_builtins.bool]] = None,
                 alias: Optional[pulumi.Input[_builtins.str]] = None,
                 api_url: Optional[pulumi.Input[_builtins.str]] = None,
                 authenticate_by_default: Optional[pulumi.Input[_builtins.bool]] = None,
                 base_url: Optional[pulumi.Input[_builtins.str]] = None,
                 client_id: Optional[pulumi.Input[_builtins.str]] = None,
                 client_secret: Optional[pulumi.Input[_builtins.str]] = None,
                 default_scopes: Optional[pulumi.Input[_builtins.str]] = None,
                 display_name: Optional[pulumi.Input[_builtins.str]] = None,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 extra_config: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 first_broker_login_flow_alias: Optional[pulumi.Input[_builtins.str]] = None,
                 github_json_format: Optional[pulumi.Input[_builtins.bool]] = None,
                 gui_order: Optional[pulumi.Input[_builtins.str]] = None,
                 hide_on_login_page: Optional[pulumi.Input[_builtins.bool]] = None,
                 internal_id: Optional[pulumi.Input[_builtins.str]] = None,
                 link_only: Optional[pulumi.Input[_builtins.bool]] = None,
                 org_domain: Optional[pulumi.Input[_builtins.str]] = None,
                 org_redirect_mode_email_matches: Optional[pulumi.Input[_builtins.bool]] = None,
                 organization_id: Optional[pulumi.Input[_builtins.str]] = None,
                 post_broker_login_flow_alias: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_id: Optional[pulumi.Input[_builtins.str]] = None,
                 realm: Optional[pulumi.Input[_builtins.str]] = None,
                 store_token: Optional[pulumi.Input[_builtins.bool]] = None,
                 sync_mode: Optional[pulumi.Input[_builtins.str]] = None,
                 trust_email: Optional[pulumi.Input[_builtins.bool]] = None):
        """
        Input properties used for looking up and filtering GithubIdentityProvider resources.
        :param pulumi.Input[_builtins.bool] add_read_token_role_on_create: When `true`, new users will be able to read stored tokens. This will automatically assign the `broker.read-token` role. Defaults to `false`.
        :param pulumi.Input[_builtins.str] alias: The alias for the GitHub identity provider.
        :param pulumi.Input[_builtins.str] api_url: The GitHub API URL, defaults to `https://api.github.com`.
        :param pulumi.Input[_builtins.bool] authenticate_by_default: Enable/disable authenticate users by default.
        :param pulumi.Input[_builtins.str] base_url: The GitHub base URL, defaults to `https://github.com`
        :param pulumi.Input[_builtins.str] client_id: The client or client identifier registered within the identity provider.
        :param pulumi.Input[_builtins.str] client_secret: The client or client secret registered within the identity provider. This field is able to obtain its value from vault, use $${vault.ID} format.
        :param pulumi.Input[_builtins.str] default_scopes: The scopes to be sent when asking for authorization. It can be a space-separated list of scopes. Defaults to `user:email`.
        :param pulumi.Input[_builtins.str] display_name: Display name for the GitHub identity provider in the GUI.
        :param pulumi.Input[_builtins.bool] enabled: When `true`, users will be able to log in to this realm using this identity provider. Defaults to `true`.
        :param pulumi.Input[_builtins.str] first_broker_login_flow_alias: The authentication flow to use when users log in for the first time through this identity provider. Defaults to `first broker login`.
        :param pulumi.Input[_builtins.bool] github_json_format: When `true`, GitHub API is told explicitly to accept JSON during token authentication requests. Defaults to `false`.
        :param pulumi.Input[_builtins.str] gui_order: A number defining the order of this identity provider in the GUI.
        :param pulumi.Input[_builtins.bool] hide_on_login_page: When `true`, this identity provider will be hidden on the login page. Defaults to `false`.
        :param pulumi.Input[_builtins.str] internal_id: (Computed) The unique ID that Keycloak assigns to the identity provider upon creation.
        :param pulumi.Input[_builtins.bool] link_only: When `true`, users cannot sign-in using this provider, but their existing accounts will be linked when possible. Defaults to `false`.
        :param pulumi.Input[_builtins.str] organization_id: ID of organization with which this identity is linked.
        :param pulumi.Input[_builtins.str] post_broker_login_flow_alias: The authentication flow to use after users have successfully logged in, which can be used to perform additional user verification (such as OTP checking). Defaults to an empty string, which means no post login flow will be used.
        :param pulumi.Input[_builtins.str] provider_id: The ID of the identity provider to use. Defaults to `github`, which should be used unless you have extended Keycloak and provided your own implementation.
        :param pulumi.Input[_builtins.str] realm: The name of the realm. This is unique across Keycloak.
        :param pulumi.Input[_builtins.bool] store_token: When `true`, tokens will be stored after authenticating users. Defaults to `true`.
        :param pulumi.Input[_builtins.str] sync_mode: The default sync mode to use for all mappers attached to this identity provider. Can be once of `IMPORT`, `FORCE`, or `LEGACY`.
        :param pulumi.Input[_builtins.bool] trust_email: When `true`, email addresses for users in this provider will automatically be verified regardless of the realm's email verification policy. Defaults to `false`.
        """
        if add_read_token_role_on_create is not None:
            pulumi.set(__self__, "add_read_token_role_on_create", add_read_token_role_on_create)
        if alias is not None:
            pulumi.set(__self__, "alias", alias)
        if api_url is not None:
            pulumi.set(__self__, "api_url", api_url)
        if authenticate_by_default is not None:
            pulumi.set(__self__, "authenticate_by_default", authenticate_by_default)
        if base_url is not None:
            pulumi.set(__self__, "base_url", base_url)
        if client_id is not None:
            pulumi.set(__self__, "client_id", client_id)
        if client_secret is not None:
            pulumi.set(__self__, "client_secret", client_secret)
        if default_scopes is not None:
            pulumi.set(__self__, "default_scopes", default_scopes)
        if display_name is not None:
            pulumi.set(__self__, "display_name", display_name)
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if extra_config is not None:
            pulumi.set(__self__, "extra_config", extra_config)
        if first_broker_login_flow_alias is not None:
            pulumi.set(__self__, "first_broker_login_flow_alias", first_broker_login_flow_alias)
        if github_json_format is not None:
            pulumi.set(__self__, "github_json_format", github_json_format)
        if gui_order is not None:
            pulumi.set(__self__, "gui_order", gui_order)
        if hide_on_login_page is not None:
            pulumi.set(__self__, "hide_on_login_page", hide_on_login_page)
        if internal_id is not None:
            pulumi.set(__self__, "internal_id", internal_id)
        if link_only is not None:
            pulumi.set(__self__, "link_only", link_only)
        if org_domain is not None:
            pulumi.set(__self__, "org_domain", org_domain)
        if org_redirect_mode_email_matches is not None:
            pulumi.set(__self__, "org_redirect_mode_email_matches", org_redirect_mode_email_matches)
        if organization_id is not None:
            pulumi.set(__self__, "organization_id", organization_id)
        if post_broker_login_flow_alias is not None:
            pulumi.set(__self__, "post_broker_login_flow_alias", post_broker_login_flow_alias)
        if provider_id is not None:
            pulumi.set(__self__, "provider_id", provider_id)
        if realm is not None:
            pulumi.set(__self__, "realm", realm)
        if store_token is not None:
            pulumi.set(__self__, "store_token", store_token)
        if sync_mode is not None:
            pulumi.set(__self__, "sync_mode", sync_mode)
        if trust_email is not None:
            pulumi.set(__self__, "trust_email", trust_email)

    @_builtins.property
    @pulumi.getter(name="addReadTokenRoleOnCreate")
    def add_read_token_role_on_create(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, new users will be able to read stored tokens. This will automatically assign the `broker.read-token` role. Defaults to `false`.
        """
        return pulumi.get(self, "add_read_token_role_on_create")

    @add_read_token_role_on_create.setter
    def add_read_token_role_on_create(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "add_read_token_role_on_create", value)

    @_builtins.property
    @pulumi.getter
    def alias(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The alias for the GitHub identity provider.
        """
        return pulumi.get(self, "alias")

    @alias.setter
    def alias(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "alias", value)

    @_builtins.property
    @pulumi.getter(name="apiUrl")
    def api_url(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The GitHub API URL, defaults to `https://api.github.com`.
        """
        return pulumi.get(self, "api_url")

    @api_url.setter
    def api_url(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "api_url", value)

    @_builtins.property
    @pulumi.getter(name="authenticateByDefault")
    def authenticate_by_default(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Enable/disable authenticate users by default.
        """
        return pulumi.get(self, "authenticate_by_default")

    @authenticate_by_default.setter
    def authenticate_by_default(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "authenticate_by_default", value)

    @_builtins.property
    @pulumi.getter(name="baseUrl")
    def base_url(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The GitHub base URL, defaults to `https://github.com`
        """
        return pulumi.get(self, "base_url")

    @base_url.setter
    def base_url(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "base_url", value)

    @_builtins.property
    @pulumi.getter(name="clientId")
    def client_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The client or client identifier registered within the identity provider.
        """
        return pulumi.get(self, "client_id")

    @client_id.setter
    def client_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "client_id", value)

    @_builtins.property
    @pulumi.getter(name="clientSecret")
    def client_secret(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The client or client secret registered within the identity provider. This field is able to obtain its value from vault, use $${vault.ID} format.
        """
        return pulumi.get(self, "client_secret")

    @client_secret.setter
    def client_secret(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "client_secret", value)

    @_builtins.property
    @pulumi.getter(name="defaultScopes")
    def default_scopes(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The scopes to be sent when asking for authorization. It can be a space-separated list of scopes. Defaults to `user:email`.
        """
        return pulumi.get(self, "default_scopes")

    @default_scopes.setter
    def default_scopes(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "default_scopes", value)

    @_builtins.property
    @pulumi.getter(name="displayName")
    def display_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Display name for the GitHub identity provider in the GUI.
        """
        return pulumi.get(self, "display_name")

    @display_name.setter
    def display_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "display_name", value)

    @_builtins.property
    @pulumi.getter
    def enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, users will be able to log in to this realm using this identity provider. Defaults to `true`.
        """
        return pulumi.get(self, "enabled")

    @enabled.setter
    def enabled(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "enabled", value)

    @_builtins.property
    @pulumi.getter(name="extraConfig")
    def extra_config(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]:
        return pulumi.get(self, "extra_config")

    @extra_config.setter
    def extra_config(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]):
        pulumi.set(self, "extra_config", value)

    @_builtins.property
    @pulumi.getter(name="firstBrokerLoginFlowAlias")
    def first_broker_login_flow_alias(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The authentication flow to use when users log in for the first time through this identity provider. Defaults to `first broker login`.
        """
        return pulumi.get(self, "first_broker_login_flow_alias")

    @first_broker_login_flow_alias.setter
    def first_broker_login_flow_alias(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "first_broker_login_flow_alias", value)

    @_builtins.property
    @pulumi.getter(name="githubJsonFormat")
    def github_json_format(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, GitHub API is told explicitly to accept JSON during token authentication requests. Defaults to `false`.
        """
        return pulumi.get(self, "github_json_format")

    @github_json_format.setter
    def github_json_format(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "github_json_format", value)

    @_builtins.property
    @pulumi.getter(name="guiOrder")
    def gui_order(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        A number defining the order of this identity provider in the GUI.
        """
        return pulumi.get(self, "gui_order")

    @gui_order.setter
    def gui_order(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "gui_order", value)

    @_builtins.property
    @pulumi.getter(name="hideOnLoginPage")
    def hide_on_login_page(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, this identity provider will be hidden on the login page. Defaults to `false`.
        """
        return pulumi.get(self, "hide_on_login_page")

    @hide_on_login_page.setter
    def hide_on_login_page(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "hide_on_login_page", value)

    @_builtins.property
    @pulumi.getter(name="internalId")
    def internal_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (Computed) The unique ID that Keycloak assigns to the identity provider upon creation.
        """
        return pulumi.get(self, "internal_id")

    @internal_id.setter
    def internal_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "internal_id", value)

    @_builtins.property
    @pulumi.getter(name="linkOnly")
    def link_only(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, users cannot sign-in using this provider, but their existing accounts will be linked when possible. Defaults to `false`.
        """
        return pulumi.get(self, "link_only")

    @link_only.setter
    def link_only(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "link_only", value)

    @_builtins.property
    @pulumi.getter(name="orgDomain")
    def org_domain(self) -> Optional[pulumi.Input[_builtins.str]]:
        return pulumi.get(self, "org_domain")

    @org_domain.setter
    def org_domain(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "org_domain", value)

    @_builtins.property
    @pulumi.getter(name="orgRedirectModeEmailMatches")
    def org_redirect_mode_email_matches(self) -> Optional[pulumi.Input[_builtins.bool]]:
        return pulumi.get(self, "org_redirect_mode_email_matches")

    @org_redirect_mode_email_matches.setter
    def org_redirect_mode_email_matches(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "org_redirect_mode_email_matches", value)

    @_builtins.property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        ID of organization with which this identity is linked.
        """
        return pulumi.get(self, "organization_id")

    @organization_id.setter
    def organization_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "organization_id", value)

    @_builtins.property
    @pulumi.getter(name="postBrokerLoginFlowAlias")
    def post_broker_login_flow_alias(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The authentication flow to use after users have successfully logged in, which can be used to perform additional user verification (such as OTP checking). Defaults to an empty string, which means no post login flow will be used.
        """
        return pulumi.get(self, "post_broker_login_flow_alias")

    @post_broker_login_flow_alias.setter
    def post_broker_login_flow_alias(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "post_broker_login_flow_alias", value)

    @_builtins.property
    @pulumi.getter(name="providerId")
    def provider_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the identity provider to use. Defaults to `github`, which should be used unless you have extended Keycloak and provided your own implementation.
        """
        return pulumi.get(self, "provider_id")

    @provider_id.setter
    def provider_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "provider_id", value)

    @_builtins.property
    @pulumi.getter
    def realm(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the realm. This is unique across Keycloak.
        """
        return pulumi.get(self, "realm")

    @realm.setter
    def realm(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "realm", value)

    @_builtins.property
    @pulumi.getter(name="storeToken")
    def store_token(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, tokens will be stored after authenticating users. Defaults to `true`.
        """
        return pulumi.get(self, "store_token")

    @store_token.setter
    def store_token(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "store_token", value)

    @_builtins.property
    @pulumi.getter(name="syncMode")
    def sync_mode(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The default sync mode to use for all mappers attached to this identity provider. Can be once of `IMPORT`, `FORCE`, or `LEGACY`.
        """
        return pulumi.get(self, "sync_mode")

    @sync_mode.setter
    def sync_mode(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "sync_mode", value)

    @_builtins.property
    @pulumi.getter(name="trustEmail")
    def trust_email(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When `true`, email addresses for users in this provider will automatically be verified regardless of the realm's email verification policy. Defaults to `false`.
        """
        return pulumi.get(self, "trust_email")

    @trust_email.setter
    def trust_email(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "trust_email", value)


@pulumi.type_token("keycloak:oidc/githubIdentityProvider:GithubIdentityProvider")
class GithubIdentityProvider(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 add_read_token_role_on_create: Optional[pulumi.Input[_builtins.bool]] = None,
                 alias: Optional[pulumi.Input[_builtins.str]] = None,
                 api_url: Optional[pulumi.Input[_builtins.str]] = None,
                 authenticate_by_default: Optional[pulumi.Input[_builtins.bool]] = None,
                 base_url: Optional[pulumi.Input[_builtins.str]] = None,
                 client_id: Optional[pulumi.Input[_builtins.str]] = None,
                 client_secret: Optional[pulumi.Input[_builtins.str]] = None,
                 default_scopes: Optional[pulumi.Input[_builtins.str]] = None,
                 display_name: Optional[pulumi.Input[_builtins.str]] = None,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 extra_config: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 first_broker_login_flow_alias: Optional[pulumi.Input[_builtins.str]] = None,
                 github_json_format: Optional[pulumi.Input[_builtins.bool]] = None,
                 gui_order: Optional[pulumi.Input[_builtins.str]] = None,
                 hide_on_login_page: Optional[pulumi.Input[_builtins.bool]] = None,
                 link_only: Optional[pulumi.Input[_builtins.bool]] = None,
                 org_domain: Optional[pulumi.Input[_builtins.str]] = None,
                 org_redirect_mode_email_matches: Optional[pulumi.Input[_builtins.bool]] = None,
                 organization_id: Optional[pulumi.Input[_builtins.str]] = None,
                 post_broker_login_flow_alias: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_id: Optional[pulumi.Input[_builtins.str]] = None,
                 realm: Optional[pulumi.Input[_builtins.str]] = None,
                 store_token: Optional[pulumi.Input[_builtins.bool]] = None,
                 sync_mode: Optional[pulumi.Input[_builtins.str]] = None,
                 trust_email: Optional[pulumi.Input[_builtins.bool]] = None,
                 __props__=None):
        """
        Allows for creating and managing **GitHub**-based OIDC Identity Providers within Keycloak.

        OIDC (OpenID Connect) identity providers allows users to authenticate through a third party system using the OIDC standard.

        The GitHub variant is specialized for the public GitHub instance (github.com) or GitHub Enterprise deployments.

        For example, it will obtain automatically the primary email from the logged in account.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_keycloak as keycloak

        realm = keycloak.Realm("realm",
            realm="my-realm",
            enabled=True)
        github = keycloak.oidc.GithubIdentityProvider("github",
            realm=realm.id,
            client_id=github_identity_provider_client_id,
            client_secret=github_identity_provider_client_secret,
            trust_email=True,
            sync_mode="IMPORT",
            extra_config={
                "myCustomConfigKey": "myValue",
            })
        ```

        ## Import

        GitHub Identity providers can be imported using the format {{realm_id}}/{{idp_alias}}, where idp_alias is the identity provider alias.

        Example:

        bash

        ```sh
        $ pulumi import keycloak:oidc/githubIdentityProvider:GithubIdentityProvider github_identity_provider my-realm/my-github-idp
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.bool] add_read_token_role_on_create: When `true`, new users will be able to read stored tokens. This will automatically assign the `broker.read-token` role. Defaults to `false`.
        :param pulumi.Input[_builtins.str] alias: The alias for the GitHub identity provider.
        :param pulumi.Input[_builtins.str] api_url: The GitHub API URL, defaults to `https://api.github.com`.
        :param pulumi.Input[_builtins.bool] authenticate_by_default: Enable/disable authenticate users by default.
        :param pulumi.Input[_builtins.str] base_url: The GitHub base URL, defaults to `https://github.com`
        :param pulumi.Input[_builtins.str] client_id: The client or client identifier registered within the identity provider.
        :param pulumi.Input[_builtins.str] client_secret: The client or client secret registered within the identity provider. This field is able to obtain its value from vault, use $${vault.ID} format.
        :param pulumi.Input[_builtins.str] default_scopes: The scopes to be sent when asking for authorization. It can be a space-separated list of scopes. Defaults to `user:email`.
        :param pulumi.Input[_builtins.str] display_name: Display name for the GitHub identity provider in the GUI.
        :param pulumi.Input[_builtins.bool] enabled: When `true`, users will be able to log in to this realm using this identity provider. Defaults to `true`.
        :param pulumi.Input[_builtins.str] first_broker_login_flow_alias: The authentication flow to use when users log in for the first time through this identity provider. Defaults to `first broker login`.
        :param pulumi.Input[_builtins.bool] github_json_format: When `true`, GitHub API is told explicitly to accept JSON during token authentication requests. Defaults to `false`.
        :param pulumi.Input[_builtins.str] gui_order: A number defining the order of this identity provider in the GUI.
        :param pulumi.Input[_builtins.bool] hide_on_login_page: When `true`, this identity provider will be hidden on the login page. Defaults to `false`.
        :param pulumi.Input[_builtins.bool] link_only: When `true`, users cannot sign-in using this provider, but their existing accounts will be linked when possible. Defaults to `false`.
        :param pulumi.Input[_builtins.str] organization_id: ID of organization with which this identity is linked.
        :param pulumi.Input[_builtins.str] post_broker_login_flow_alias: The authentication flow to use after users have successfully logged in, which can be used to perform additional user verification (such as OTP checking). Defaults to an empty string, which means no post login flow will be used.
        :param pulumi.Input[_builtins.str] provider_id: The ID of the identity provider to use. Defaults to `github`, which should be used unless you have extended Keycloak and provided your own implementation.
        :param pulumi.Input[_builtins.str] realm: The name of the realm. This is unique across Keycloak.
        :param pulumi.Input[_builtins.bool] store_token: When `true`, tokens will be stored after authenticating users. Defaults to `true`.
        :param pulumi.Input[_builtins.str] sync_mode: The default sync mode to use for all mappers attached to this identity provider. Can be once of `IMPORT`, `FORCE`, or `LEGACY`.
        :param pulumi.Input[_builtins.bool] trust_email: When `true`, email addresses for users in this provider will automatically be verified regardless of the realm's email verification policy. Defaults to `false`.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: GithubIdentityProviderArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Allows for creating and managing **GitHub**-based OIDC Identity Providers within Keycloak.

        OIDC (OpenID Connect) identity providers allows users to authenticate through a third party system using the OIDC standard.

        The GitHub variant is specialized for the public GitHub instance (github.com) or GitHub Enterprise deployments.

        For example, it will obtain automatically the primary email from the logged in account.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_keycloak as keycloak

        realm = keycloak.Realm("realm",
            realm="my-realm",
            enabled=True)
        github = keycloak.oidc.GithubIdentityProvider("github",
            realm=realm.id,
            client_id=github_identity_provider_client_id,
            client_secret=github_identity_provider_client_secret,
            trust_email=True,
            sync_mode="IMPORT",
            extra_config={
                "myCustomConfigKey": "myValue",
            })
        ```

        ## Import

        GitHub Identity providers can be imported using the format {{realm_id}}/{{idp_alias}}, where idp_alias is the identity provider alias.

        Example:

        bash

        ```sh
        $ pulumi import keycloak:oidc/githubIdentityProvider:GithubIdentityProvider github_identity_provider my-realm/my-github-idp
        ```

        :param str resource_name: The name of the resource.
        :param GithubIdentityProviderArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(GithubIdentityProviderArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 add_read_token_role_on_create: Optional[pulumi.Input[_builtins.bool]] = None,
                 alias: Optional[pulumi.Input[_builtins.str]] = None,
                 api_url: Optional[pulumi.Input[_builtins.str]] = None,
                 authenticate_by_default: Optional[pulumi.Input[_builtins.bool]] = None,
                 base_url: Optional[pulumi.Input[_builtins.str]] = None,
                 client_id: Optional[pulumi.Input[_builtins.str]] = None,
                 client_secret: Optional[pulumi.Input[_builtins.str]] = None,
                 default_scopes: Optional[pulumi.Input[_builtins.str]] = None,
                 display_name: Optional[pulumi.Input[_builtins.str]] = None,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 extra_config: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
                 first_broker_login_flow_alias: Optional[pulumi.Input[_builtins.str]] = None,
                 github_json_format: Optional[pulumi.Input[_builtins.bool]] = None,
                 gui_order: Optional[pulumi.Input[_builtins.str]] = None,
                 hide_on_login_page: Optional[pulumi.Input[_builtins.bool]] = None,
                 link_only: Optional[pulumi.Input[_builtins.bool]] = None,
                 org_domain: Optional[pulumi.Input[_builtins.str]] = None,
                 org_redirect_mode_email_matches: Optional[pulumi.Input[_builtins.bool]] = None,
                 organization_id: Optional[pulumi.Input[_builtins.str]] = None,
                 post_broker_login_flow_alias: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_id: Optional[pulumi.Input[_builtins.str]] = None,
                 realm: Optional[pulumi.Input[_builtins.str]] = None,
                 store_token: Optional[pulumi.Input[_builtins.bool]] = None,
                 sync_mode: Optional[pulumi.Input[_builtins.str]] = None,
                 trust_email: Optional[pulumi.Input[_builtins.bool]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = GithubIdentityProviderArgs.__new__(GithubIdentityProviderArgs)

            __props__.__dict__["add_read_token_role_on_create"] = add_read_token_role_on_create
            __props__.__dict__["alias"] = alias
            __props__.__dict__["api_url"] = api_url
            __props__.__dict__["authenticate_by_default"] = authenticate_by_default
            __props__.__dict__["base_url"] = base_url
            if client_id is None and not opts.urn:
                raise TypeError("Missing required property 'client_id'")
            __props__.__dict__["client_id"] = client_id
            if client_secret is None and not opts.urn:
                raise TypeError("Missing required property 'client_secret'")
            __props__.__dict__["client_secret"] = None if client_secret is None else pulumi.Output.secret(client_secret)
            __props__.__dict__["default_scopes"] = default_scopes
            __props__.__dict__["display_name"] = display_name
            __props__.__dict__["enabled"] = enabled
            __props__.__dict__["extra_config"] = extra_config
            __props__.__dict__["first_broker_login_flow_alias"] = first_broker_login_flow_alias
            __props__.__dict__["github_json_format"] = github_json_format
            __props__.__dict__["gui_order"] = gui_order
            __props__.__dict__["hide_on_login_page"] = hide_on_login_page
            __props__.__dict__["link_only"] = link_only
            __props__.__dict__["org_domain"] = org_domain
            __props__.__dict__["org_redirect_mode_email_matches"] = org_redirect_mode_email_matches
            __props__.__dict__["organization_id"] = organization_id
            __props__.__dict__["post_broker_login_flow_alias"] = post_broker_login_flow_alias
            __props__.__dict__["provider_id"] = provider_id
            if realm is None and not opts.urn:
                raise TypeError("Missing required property 'realm'")
            __props__.__dict__["realm"] = realm
            __props__.__dict__["store_token"] = store_token
            __props__.__dict__["sync_mode"] = sync_mode
            __props__.__dict__["trust_email"] = trust_email
            __props__.__dict__["internal_id"] = None
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["clientSecret"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(GithubIdentityProvider, __self__).__init__(
            'keycloak:oidc/githubIdentityProvider:GithubIdentityProvider',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            add_read_token_role_on_create: Optional[pulumi.Input[_builtins.bool]] = None,
            alias: Optional[pulumi.Input[_builtins.str]] = None,
            api_url: Optional[pulumi.Input[_builtins.str]] = None,
            authenticate_by_default: Optional[pulumi.Input[_builtins.bool]] = None,
            base_url: Optional[pulumi.Input[_builtins.str]] = None,
            client_id: Optional[pulumi.Input[_builtins.str]] = None,
            client_secret: Optional[pulumi.Input[_builtins.str]] = None,
            default_scopes: Optional[pulumi.Input[_builtins.str]] = None,
            display_name: Optional[pulumi.Input[_builtins.str]] = None,
            enabled: Optional[pulumi.Input[_builtins.bool]] = None,
            extra_config: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
            first_broker_login_flow_alias: Optional[pulumi.Input[_builtins.str]] = None,
            github_json_format: Optional[pulumi.Input[_builtins.bool]] = None,
            gui_order: Optional[pulumi.Input[_builtins.str]] = None,
            hide_on_login_page: Optional[pulumi.Input[_builtins.bool]] = None,
            internal_id: Optional[pulumi.Input[_builtins.str]] = None,
            link_only: Optional[pulumi.Input[_builtins.bool]] = None,
            org_domain: Optional[pulumi.Input[_builtins.str]] = None,
            org_redirect_mode_email_matches: Optional[pulumi.Input[_builtins.bool]] = None,
            organization_id: Optional[pulumi.Input[_builtins.str]] = None,
            post_broker_login_flow_alias: Optional[pulumi.Input[_builtins.str]] = None,
            provider_id: Optional[pulumi.Input[_builtins.str]] = None,
            realm: Optional[pulumi.Input[_builtins.str]] = None,
            store_token: Optional[pulumi.Input[_builtins.bool]] = None,
            sync_mode: Optional[pulumi.Input[_builtins.str]] = None,
            trust_email: Optional[pulumi.Input[_builtins.bool]] = None) -> 'GithubIdentityProvider':
        """
        Get an existing GithubIdentityProvider resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.bool] add_read_token_role_on_create: When `true`, new users will be able to read stored tokens. This will automatically assign the `broker.read-token` role. Defaults to `false`.
        :param pulumi.Input[_builtins.str] alias: The alias for the GitHub identity provider.
        :param pulumi.Input[_builtins.str] api_url: The GitHub API URL, defaults to `https://api.github.com`.
        :param pulumi.Input[_builtins.bool] authenticate_by_default: Enable/disable authenticate users by default.
        :param pulumi.Input[_builtins.str] base_url: The GitHub base URL, defaults to `https://github.com`
        :param pulumi.Input[_builtins.str] client_id: The client or client identifier registered within the identity provider.
        :param pulumi.Input[_builtins.str] client_secret: The client or client secret registered within the identity provider. This field is able to obtain its value from vault, use $${vault.ID} format.
        :param pulumi.Input[_builtins.str] default_scopes: The scopes to be sent when asking for authorization. It can be a space-separated list of scopes. Defaults to `user:email`.
        :param pulumi.Input[_builtins.str] display_name: Display name for the GitHub identity provider in the GUI.
        :param pulumi.Input[_builtins.bool] enabled: When `true`, users will be able to log in to this realm using this identity provider. Defaults to `true`.
        :param pulumi.Input[_builtins.str] first_broker_login_flow_alias: The authentication flow to use when users log in for the first time through this identity provider. Defaults to `first broker login`.
        :param pulumi.Input[_builtins.bool] github_json_format: When `true`, GitHub API is told explicitly to accept JSON during token authentication requests. Defaults to `false`.
        :param pulumi.Input[_builtins.str] gui_order: A number defining the order of this identity provider in the GUI.
        :param pulumi.Input[_builtins.bool] hide_on_login_page: When `true`, this identity provider will be hidden on the login page. Defaults to `false`.
        :param pulumi.Input[_builtins.str] internal_id: (Computed) The unique ID that Keycloak assigns to the identity provider upon creation.
        :param pulumi.Input[_builtins.bool] link_only: When `true`, users cannot sign-in using this provider, but their existing accounts will be linked when possible. Defaults to `false`.
        :param pulumi.Input[_builtins.str] organization_id: ID of organization with which this identity is linked.
        :param pulumi.Input[_builtins.str] post_broker_login_flow_alias: The authentication flow to use after users have successfully logged in, which can be used to perform additional user verification (such as OTP checking). Defaults to an empty string, which means no post login flow will be used.
        :param pulumi.Input[_builtins.str] provider_id: The ID of the identity provider to use. Defaults to `github`, which should be used unless you have extended Keycloak and provided your own implementation.
        :param pulumi.Input[_builtins.str] realm: The name of the realm. This is unique across Keycloak.
        :param pulumi.Input[_builtins.bool] store_token: When `true`, tokens will be stored after authenticating users. Defaults to `true`.
        :param pulumi.Input[_builtins.str] sync_mode: The default sync mode to use for all mappers attached to this identity provider. Can be once of `IMPORT`, `FORCE`, or `LEGACY`.
        :param pulumi.Input[_builtins.bool] trust_email: When `true`, email addresses for users in this provider will automatically be verified regardless of the realm's email verification policy. Defaults to `false`.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _GithubIdentityProviderState.__new__(_GithubIdentityProviderState)

        __props__.__dict__["add_read_token_role_on_create"] = add_read_token_role_on_create
        __props__.__dict__["alias"] = alias
        __props__.__dict__["api_url"] = api_url
        __props__.__dict__["authenticate_by_default"] = authenticate_by_default
        __props__.__dict__["base_url"] = base_url
        __props__.__dict__["client_id"] = client_id
        __props__.__dict__["client_secret"] = client_secret
        __props__.__dict__["default_scopes"] = default_scopes
        __props__.__dict__["display_name"] = display_name
        __props__.__dict__["enabled"] = enabled
        __props__.__dict__["extra_config"] = extra_config
        __props__.__dict__["first_broker_login_flow_alias"] = first_broker_login_flow_alias
        __props__.__dict__["github_json_format"] = github_json_format
        __props__.__dict__["gui_order"] = gui_order
        __props__.__dict__["hide_on_login_page"] = hide_on_login_page
        __props__.__dict__["internal_id"] = internal_id
        __props__.__dict__["link_only"] = link_only
        __props__.__dict__["org_domain"] = org_domain
        __props__.__dict__["org_redirect_mode_email_matches"] = org_redirect_mode_email_matches
        __props__.__dict__["organization_id"] = organization_id
        __props__.__dict__["post_broker_login_flow_alias"] = post_broker_login_flow_alias
        __props__.__dict__["provider_id"] = provider_id
        __props__.__dict__["realm"] = realm
        __props__.__dict__["store_token"] = store_token
        __props__.__dict__["sync_mode"] = sync_mode
        __props__.__dict__["trust_email"] = trust_email
        return GithubIdentityProvider(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="addReadTokenRoleOnCreate")
    def add_read_token_role_on_create(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        When `true`, new users will be able to read stored tokens. This will automatically assign the `broker.read-token` role. Defaults to `false`.
        """
        return pulumi.get(self, "add_read_token_role_on_create")

    @_builtins.property
    @pulumi.getter
    def alias(self) -> pulumi.Output[_builtins.str]:
        """
        The alias for the GitHub identity provider.
        """
        return pulumi.get(self, "alias")

    @_builtins.property
    @pulumi.getter(name="apiUrl")
    def api_url(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The GitHub API URL, defaults to `https://api.github.com`.
        """
        return pulumi.get(self, "api_url")

    @_builtins.property
    @pulumi.getter(name="authenticateByDefault")
    def authenticate_by_default(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Enable/disable authenticate users by default.
        """
        return pulumi.get(self, "authenticate_by_default")

    @_builtins.property
    @pulumi.getter(name="baseUrl")
    def base_url(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The GitHub base URL, defaults to `https://github.com`
        """
        return pulumi.get(self, "base_url")

    @_builtins.property
    @pulumi.getter(name="clientId")
    def client_id(self) -> pulumi.Output[_builtins.str]:
        """
        The client or client identifier registered within the identity provider.
        """
        return pulumi.get(self, "client_id")

    @_builtins.property
    @pulumi.getter(name="clientSecret")
    def client_secret(self) -> pulumi.Output[_builtins.str]:
        """
        The client or client secret registered within the identity provider. This field is able to obtain its value from vault, use $${vault.ID} format.
        """
        return pulumi.get(self, "client_secret")

    @_builtins.property
    @pulumi.getter(name="defaultScopes")
    def default_scopes(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The scopes to be sent when asking for authorization. It can be a space-separated list of scopes. Defaults to `user:email`.
        """
        return pulumi.get(self, "default_scopes")

    @_builtins.property
    @pulumi.getter(name="displayName")
    def display_name(self) -> pulumi.Output[_builtins.str]:
        """
        Display name for the GitHub identity provider in the GUI.
        """
        return pulumi.get(self, "display_name")

    @_builtins.property
    @pulumi.getter
    def enabled(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        When `true`, users will be able to log in to this realm using this identity provider. Defaults to `true`.
        """
        return pulumi.get(self, "enabled")

    @_builtins.property
    @pulumi.getter(name="extraConfig")
    def extra_config(self) -> pulumi.Output[Optional[Mapping[str, _builtins.str]]]:
        return pulumi.get(self, "extra_config")

    @_builtins.property
    @pulumi.getter(name="firstBrokerLoginFlowAlias")
    def first_broker_login_flow_alias(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The authentication flow to use when users log in for the first time through this identity provider. Defaults to `first broker login`.
        """
        return pulumi.get(self, "first_broker_login_flow_alias")

    @_builtins.property
    @pulumi.getter(name="githubJsonFormat")
    def github_json_format(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        When `true`, GitHub API is told explicitly to accept JSON during token authentication requests. Defaults to `false`.
        """
        return pulumi.get(self, "github_json_format")

    @_builtins.property
    @pulumi.getter(name="guiOrder")
    def gui_order(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        A number defining the order of this identity provider in the GUI.
        """
        return pulumi.get(self, "gui_order")

    @_builtins.property
    @pulumi.getter(name="hideOnLoginPage")
    def hide_on_login_page(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        When `true`, this identity provider will be hidden on the login page. Defaults to `false`.
        """
        return pulumi.get(self, "hide_on_login_page")

    @_builtins.property
    @pulumi.getter(name="internalId")
    def internal_id(self) -> pulumi.Output[_builtins.str]:
        """
        (Computed) The unique ID that Keycloak assigns to the identity provider upon creation.
        """
        return pulumi.get(self, "internal_id")

    @_builtins.property
    @pulumi.getter(name="linkOnly")
    def link_only(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        When `true`, users cannot sign-in using this provider, but their existing accounts will be linked when possible. Defaults to `false`.
        """
        return pulumi.get(self, "link_only")

    @_builtins.property
    @pulumi.getter(name="orgDomain")
    def org_domain(self) -> pulumi.Output[Optional[_builtins.str]]:
        return pulumi.get(self, "org_domain")

    @_builtins.property
    @pulumi.getter(name="orgRedirectModeEmailMatches")
    def org_redirect_mode_email_matches(self) -> pulumi.Output[Optional[_builtins.bool]]:
        return pulumi.get(self, "org_redirect_mode_email_matches")

    @_builtins.property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        ID of organization with which this identity is linked.
        """
        return pulumi.get(self, "organization_id")

    @_builtins.property
    @pulumi.getter(name="postBrokerLoginFlowAlias")
    def post_broker_login_flow_alias(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The authentication flow to use after users have successfully logged in, which can be used to perform additional user verification (such as OTP checking). Defaults to an empty string, which means no post login flow will be used.
        """
        return pulumi.get(self, "post_broker_login_flow_alias")

    @_builtins.property
    @pulumi.getter(name="providerId")
    def provider_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The ID of the identity provider to use. Defaults to `github`, which should be used unless you have extended Keycloak and provided your own implementation.
        """
        return pulumi.get(self, "provider_id")

    @_builtins.property
    @pulumi.getter
    def realm(self) -> pulumi.Output[_builtins.str]:
        """
        The name of the realm. This is unique across Keycloak.
        """
        return pulumi.get(self, "realm")

    @_builtins.property
    @pulumi.getter(name="storeToken")
    def store_token(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        When `true`, tokens will be stored after authenticating users. Defaults to `true`.
        """
        return pulumi.get(self, "store_token")

    @_builtins.property
    @pulumi.getter(name="syncMode")
    def sync_mode(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The default sync mode to use for all mappers attached to this identity provider. Can be once of `IMPORT`, `FORCE`, or `LEGACY`.
        """
        return pulumi.get(self, "sync_mode")

    @_builtins.property
    @pulumi.getter(name="trustEmail")
    def trust_email(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        When `true`, email addresses for users in this provider will automatically be verified regardless of the realm's email verification policy. Defaults to `false`.
        """
        return pulumi.get(self, "trust_email")

