1. Registry
  2. Packages
  3. Okta Provider
  4. API Docs
  5. OrgCaptcha
Viewing docs for Okta v7.0.0
published on Friday, Sep 11, 2026 by Pulumi
okta logo
Viewing docs for Okta v7.0.0
published on Friday, Sep 11, 2026 by Pulumi

    As an option to increase org security, Okta supports CAPTCHA services to prevent automated sign-in attempts.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const testCaptcha = new okta.Captcha("test_captcha", {
        name: "testAcc_replace_with_uuid",
        type: "HCAPTCHA",
        siteKey: "random_key",
        secretKey: "random_secret_key",
    });
    const test = new okta.OrgCaptcha("test", {
        captchaId: testCaptcha.id,
        enabledPages: ["SIGN_IN"],
    });
    
    import pulumi
    import pulumi_okta as okta
    
    test_captcha = okta.Captcha("test_captcha",
        name="testAcc_replace_with_uuid",
        type="HCAPTCHA",
        site_key="random_key",
        secret_key="random_secret_key")
    test = okta.OrgCaptcha("test",
        captcha_id=test_captcha.id,
        enabled_pages=["SIGN_IN"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v7/go/okta"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		testCaptcha, err := okta.NewCaptcha(ctx, "test_captcha", &okta.CaptchaArgs{
    			Name:      pulumi.String("testAcc_replace_with_uuid"),
    			Type:      pulumi.String("HCAPTCHA"),
    			SiteKey:   pulumi.String("random_key"),
    			SecretKey: pulumi.String("random_secret_key"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = okta.NewOrgCaptcha(ctx, "test", &okta.OrgCaptchaArgs{
    			CaptchaId: testCaptcha.ID().ToIDOutput().ToStringOutput(),
    			EnabledPages: pulumi.StringArray{
    				pulumi.String("SIGN_IN"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Okta = Pulumi.Okta;
    
    return await Deployment.RunAsync(() => 
    {
        var testCaptcha = new Okta.Captcha("test_captcha", new()
        {
            Name = "testAcc_replace_with_uuid",
            Type = "HCAPTCHA",
            SiteKey = "random_key",
            SecretKey = "random_secret_key",
        });
    
        var test = new Okta.OrgCaptcha("test", new()
        {
            CaptchaId = testCaptcha.Id,
            EnabledPages = new[]
            {
                "SIGN_IN",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.Captcha;
    import com.pulumi.okta.CaptchaArgs;
    import com.pulumi.okta.OrgCaptcha;
    import com.pulumi.okta.OrgCaptchaArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var testCaptcha = new Captcha("testCaptcha", CaptchaArgs.builder()
                .name("testAcc_replace_with_uuid")
                .type("HCAPTCHA")
                .siteKey("random_key")
                .secretKey("random_secret_key")
                .build());
    
            var test = new OrgCaptcha("test", OrgCaptchaArgs.builder()
                .captchaId(testCaptcha.id())
                .enabledPages("SIGN_IN")
                .build());
    
        }
    }
    
    resources:
      testCaptcha:
        type: okta:Captcha
        name: test_captcha
        properties:
          name: testAcc_replace_with_uuid
          type: HCAPTCHA
          siteKey: random_key
          secretKey: random_secret_key
      test:
        type: okta:OrgCaptcha
        properties:
          captchaId: ${testCaptcha.id}
          enabledPages:
            - SIGN_IN
    
    pulumi {
      required_providers {
        okta = {
          source = "pulumi/okta"
        }
      }
    }
    
    resource "okta_captcha" "test_captcha" {
      name       = "testAcc_replace_with_uuid"
      type       = "HCAPTCHA"
      site_key   = "random_key"
      secret_key = "random_secret_key"
    }
    resource "okta_orgcaptcha" "test" {
      captcha_id    = okta_captcha.test_captcha.id
      enabled_pages = ["SIGN_IN"]
    }
    

    Upgrading from okta.CaptchaOrgWideSettings

    okta.OrgCaptcha replaces the deprecated okta.CaptchaOrgWideSettings resource. As part of the migration, the enabledFor attribute (a set of strings) was renamed to enabledPages (a list of strings). Update existing configurations as follows:

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    // Before
    const example = new okta.CaptchaOrgWideSettings("example", {
        captchaId: exampleOktaCaptcha.id,
        enabledFors: ["SIGN_IN"],
    });
    // After
    const exampleOrgCaptcha = new okta.OrgCaptcha("example", {
        captchaId: exampleOktaCaptcha.id,
        enabledPages: ["SIGN_IN"],
    });
    
    import pulumi
    import pulumi_okta as okta
    
    # Before
    example = okta.CaptchaOrgWideSettings("example",
        captcha_id=example_okta_captcha["id"],
        enabled_fors=["SIGN_IN"])
    # After
    example_org_captcha = okta.OrgCaptcha("example",
        captcha_id=example_okta_captcha["id"],
        enabled_pages=["SIGN_IN"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v7/go/okta"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Before
    		_, err := okta.NewCaptchaOrgWideSettings(ctx, "example", &okta.CaptchaOrgWideSettingsArgs{
    			CaptchaId: pulumi.Any(exampleOktaCaptcha.Id),
    			EnabledFors: pulumi.StringArray{
    				pulumi.String("SIGN_IN"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// After
    		_, err = okta.NewOrgCaptcha(ctx, "example", &okta.OrgCaptchaArgs{
    			CaptchaId: pulumi.Any(exampleOktaCaptcha.Id),
    			EnabledPages: pulumi.StringArray{
    				pulumi.String("SIGN_IN"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Okta = Pulumi.Okta;
    
    return await Deployment.RunAsync(() => 
    {
        // Before
        var example = new Okta.CaptchaOrgWideSettings("example", new()
        {
            CaptchaId = exampleOktaCaptcha.Id,
            EnabledFors = new[]
            {
                "SIGN_IN",
            },
        });
    
        // After
        var exampleOrgCaptcha = new Okta.OrgCaptcha("example", new()
        {
            CaptchaId = exampleOktaCaptcha.Id,
            EnabledPages = new[]
            {
                "SIGN_IN",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.CaptchaOrgWideSettings;
    import com.pulumi.okta.CaptchaOrgWideSettingsArgs;
    import com.pulumi.okta.OrgCaptcha;
    import com.pulumi.okta.OrgCaptchaArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            // Before
            var example = new CaptchaOrgWideSettings("example", CaptchaOrgWideSettingsArgs.builder()
                .captchaId(exampleOktaCaptcha.id())
                .enabledFors("SIGN_IN")
                .build());
    
            // After
            var exampleOrgCaptcha = new OrgCaptcha("exampleOrgCaptcha", OrgCaptchaArgs.builder()
                .captchaId(exampleOktaCaptcha.id())
                .enabledPages("SIGN_IN")
                .build());
    
        }
    }
    
    resources:
      # Before
      example:
        type: okta:CaptchaOrgWideSettings
        properties:
          captchaId: ${exampleOktaCaptcha.id}
          enabledFors:
            - SIGN_IN
      # After
      exampleOrgCaptcha:
        type: okta:OrgCaptcha
        name: example
        properties:
          captchaId: ${exampleOktaCaptcha.id}
          enabledPages:
            - SIGN_IN
    
    pulumi {
      required_providers {
        okta = {
          source = "pulumi/okta"
        }
      }
    }
    
    # Before
    resource "okta_captchaorgwidesettings" "example" {
      captcha_id   = exampleOktaCaptcha.id
      enabled_fors = ["SIGN_IN"]
    }
    # After
    resource "okta_orgcaptcha" "example" {
      captcha_id    = exampleOktaCaptcha.id
      enabled_pages = ["SIGN_IN"]
    }
    

    Create OrgCaptcha Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new OrgCaptcha(name: string, args?: OrgCaptchaArgs, opts?: CustomResourceOptions);
    @overload
    def OrgCaptcha(resource_name: str,
                   args: Optional[OrgCaptchaArgs] = None,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrgCaptcha(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   captcha_id: Optional[str] = None,
                   enabled_pages: Optional[Sequence[str]] = None)
    func NewOrgCaptcha(ctx *Context, name string, args *OrgCaptchaArgs, opts ...ResourceOption) (*OrgCaptcha, error)
    public OrgCaptcha(string name, OrgCaptchaArgs? args = null, CustomResourceOptions? opts = null)
    public OrgCaptcha(String name, OrgCaptchaArgs args)
    public OrgCaptcha(String name, OrgCaptchaArgs args, CustomResourceOptions options)
    
    type: okta:OrgCaptcha
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "okta_org_captcha" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args OrgCaptchaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args OrgCaptchaArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args OrgCaptchaArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrgCaptchaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrgCaptchaArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var orgCaptchaResource = new Okta.OrgCaptcha("orgCaptchaResource", new()
    {
        CaptchaId = "string",
        EnabledPages = new[]
        {
            "string",
        },
    });
    
    example, err := okta.NewOrgCaptcha(ctx, "orgCaptchaResource", &okta.OrgCaptchaArgs{
    	CaptchaId: pulumi.String("string"),
    	EnabledPages: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    resource "okta_org_captcha" "orgCaptchaResource" {
      lifecycle {
        create_before_destroy = true
      }
      captcha_id    = "string"
      enabled_pages = ["string"]
    }
    
    var orgCaptchaResource = new OrgCaptcha("orgCaptchaResource", OrgCaptchaArgs.builder()
        .captchaId("string")
        .enabledPages("string")
        .build());
    
    org_captcha_resource = okta.OrgCaptcha("orgCaptchaResource",
        captcha_id="string",
        enabled_pages=["string"])
    
    const orgCaptchaResource = new okta.OrgCaptcha("orgCaptchaResource", {
        captchaId: "string",
        enabledPages: ["string"],
    });
    
    type: okta:OrgCaptcha
    properties:
        captchaId: string
        enabledPages:
            - string
    

    OrgCaptcha Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The OrgCaptcha resource accepts the following input properties:

    CaptchaId string
    The unique key of the associated CAPTCHA instance
    EnabledPages List<string>
    An array of pages that have CAPTCHA enabled
    CaptchaId string
    The unique key of the associated CAPTCHA instance
    EnabledPages []string
    An array of pages that have CAPTCHA enabled
    captcha_id string
    The unique key of the associated CAPTCHA instance
    enabled_pages list(string)
    An array of pages that have CAPTCHA enabled
    captchaId String
    The unique key of the associated CAPTCHA instance
    enabledPages List<String>
    An array of pages that have CAPTCHA enabled
    captchaId string
    The unique key of the associated CAPTCHA instance
    enabledPages string[]
    An array of pages that have CAPTCHA enabled
    captcha_id str
    The unique key of the associated CAPTCHA instance
    enabled_pages Sequence[str]
    An array of pages that have CAPTCHA enabled
    captchaId String
    The unique key of the associated CAPTCHA instance
    enabledPages List<String>
    An array of pages that have CAPTCHA enabled

    Outputs

    All input properties are implicitly available as output properties. Additionally, the OrgCaptcha resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing OrgCaptcha Resource

    Get an existing OrgCaptcha resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: OrgCaptchaState, opts?: CustomResourceOptions): OrgCaptcha
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            captcha_id: Optional[str] = None,
            enabled_pages: Optional[Sequence[str]] = None) -> OrgCaptcha
    func GetOrgCaptcha(ctx *Context, name string, id IDInput, state *OrgCaptchaState, opts ...ResourceOption) (*OrgCaptcha, error)
    public static OrgCaptcha Get(string name, Input<string> id, OrgCaptchaState? state, CustomResourceOptions? opts = null)
    public static OrgCaptcha get(String name, Output<String> id, OrgCaptchaState state, CustomResourceOptions options)
    resources:  _:    type: okta:OrgCaptcha    get:      id: ${id}
    import {
      to = okta_org_captcha.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CaptchaId string
    The unique key of the associated CAPTCHA instance
    EnabledPages List<string>
    An array of pages that have CAPTCHA enabled
    CaptchaId string
    The unique key of the associated CAPTCHA instance
    EnabledPages []string
    An array of pages that have CAPTCHA enabled
    captcha_id string
    The unique key of the associated CAPTCHA instance
    enabled_pages list(string)
    An array of pages that have CAPTCHA enabled
    captchaId String
    The unique key of the associated CAPTCHA instance
    enabledPages List<String>
    An array of pages that have CAPTCHA enabled
    captchaId string
    The unique key of the associated CAPTCHA instance
    enabledPages string[]
    An array of pages that have CAPTCHA enabled
    captcha_id str
    The unique key of the associated CAPTCHA instance
    enabled_pages Sequence[str]
    An array of pages that have CAPTCHA enabled
    captchaId String
    The unique key of the associated CAPTCHA instance
    enabledPages List<String>
    An array of pages that have CAPTCHA enabled

    Import

    $ pulumi import okta:index/orgCaptcha:OrgCaptcha example _
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Okta pulumi/pulumi-okta
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the okta Terraform Provider.
    okta logo
    Viewing docs for Okta v7.0.0
    published on Friday, Sep 11, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial