1. Packages
  2. Okta Provider
  3. API Docs
  4. AppOauthApiScope
Okta v4.16.0 published on Wednesday, Apr 9, 2025 by Pulumi

okta.AppOauthApiScope

Explore with Pulumi AI

Manages API scopes for OAuth applications. This resource allows you to grant or revoke API scopes for OAuth2 applications within your organization. Note: you have to create an application before using this resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as okta from "@pulumi/okta";

const example = new okta.AppOauthApiScope("example", {
    appId: "<application_id>",
    issuer: "<your org domain>",
    scopes: [
        "okta.users.read",
        "okta.users.manage",
    ],
});
Copy
import pulumi
import pulumi_okta as okta

example = okta.AppOauthApiScope("example",
    app_id="<application_id>",
    issuer="<your org domain>",
    scopes=[
        "okta.users.read",
        "okta.users.manage",
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := okta.NewAppOauthApiScope(ctx, "example", &okta.AppOauthApiScopeArgs{
			AppId:  pulumi.String("<application_id>"),
			Issuer: pulumi.String("<your org domain>"),
			Scopes: pulumi.StringArray{
				pulumi.String("okta.users.read"),
				pulumi.String("okta.users.manage"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Okta = Pulumi.Okta;

return await Deployment.RunAsync(() => 
{
    var example = new Okta.AppOauthApiScope("example", new()
    {
        AppId = "<application_id>",
        Issuer = "<your org domain>",
        Scopes = new[]
        {
            "okta.users.read",
            "okta.users.manage",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.okta.AppOauthApiScope;
import com.pulumi.okta.AppOauthApiScopeArgs;
import java.util.List;
import java.util.ArrayList;
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 example = new AppOauthApiScope("example", AppOauthApiScopeArgs.builder()
            .appId("<application_id>")
            .issuer("<your org domain>")
            .scopes(            
                "okta.users.read",
                "okta.users.manage")
            .build());

    }
}
Copy
resources:
  example:
    type: okta:AppOauthApiScope
    properties:
      appId: <application_id>
      issuer: <your org domain>
      scopes:
        - okta.users.read
        - okta.users.manage
Copy

Create AppOauthApiScope Resource

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

Constructor syntax

new AppOauthApiScope(name: string, args: AppOauthApiScopeArgs, opts?: CustomResourceOptions);
@overload
def AppOauthApiScope(resource_name: str,
                     args: AppOauthApiScopeArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def AppOauthApiScope(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     app_id: Optional[str] = None,
                     issuer: Optional[str] = None,
                     scopes: Optional[Sequence[str]] = None)
func NewAppOauthApiScope(ctx *Context, name string, args AppOauthApiScopeArgs, opts ...ResourceOption) (*AppOauthApiScope, error)
public AppOauthApiScope(string name, AppOauthApiScopeArgs args, CustomResourceOptions? opts = null)
public AppOauthApiScope(String name, AppOauthApiScopeArgs args)
public AppOauthApiScope(String name, AppOauthApiScopeArgs args, CustomResourceOptions options)
type: okta:AppOauthApiScope
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AppOauthApiScopeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AppOauthApiScopeArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AppOauthApiScopeArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AppOauthApiScopeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AppOauthApiScopeArgs
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 appOauthApiScopeResource = new Okta.AppOauthApiScope("appOauthApiScopeResource", new()
{
    AppId = "string",
    Issuer = "string",
    Scopes = new[]
    {
        "string",
    },
});
Copy
example, err := okta.NewAppOauthApiScope(ctx, "appOauthApiScopeResource", &okta.AppOauthApiScopeArgs{
	AppId:  pulumi.String("string"),
	Issuer: pulumi.String("string"),
	Scopes: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var appOauthApiScopeResource = new AppOauthApiScope("appOauthApiScopeResource", AppOauthApiScopeArgs.builder()
    .appId("string")
    .issuer("string")
    .scopes("string")
    .build());
Copy
app_oauth_api_scope_resource = okta.AppOauthApiScope("appOauthApiScopeResource",
    app_id="string",
    issuer="string",
    scopes=["string"])
Copy
const appOauthApiScopeResource = new okta.AppOauthApiScope("appOauthApiScopeResource", {
    appId: "string",
    issuer: "string",
    scopes: ["string"],
});
Copy
type: okta:AppOauthApiScope
properties:
    appId: string
    issuer: string
    scopes:
        - string
Copy

AppOauthApiScope 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 AppOauthApiScope resource accepts the following input properties:

AppId
This property is required.
Changes to this property will trigger replacement.
string
ID of the application.
Issuer This property is required. string
The issuer of your Org Authorization Server, your Org URL.
Scopes This property is required. List<string>
Scopes of the application for which consent is granted.
AppId
This property is required.
Changes to this property will trigger replacement.
string
ID of the application.
Issuer This property is required. string
The issuer of your Org Authorization Server, your Org URL.
Scopes This property is required. []string
Scopes of the application for which consent is granted.
appId
This property is required.
Changes to this property will trigger replacement.
String
ID of the application.
issuer This property is required. String
The issuer of your Org Authorization Server, your Org URL.
scopes This property is required. List<String>
Scopes of the application for which consent is granted.
appId
This property is required.
Changes to this property will trigger replacement.
string
ID of the application.
issuer This property is required. string
The issuer of your Org Authorization Server, your Org URL.
scopes This property is required. string[]
Scopes of the application for which consent is granted.
app_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the application.
issuer This property is required. str
The issuer of your Org Authorization Server, your Org URL.
scopes This property is required. Sequence[str]
Scopes of the application for which consent is granted.
appId
This property is required.
Changes to this property will trigger replacement.
String
ID of the application.
issuer This property is required. String
The issuer of your Org Authorization Server, your Org URL.
scopes This property is required. List<String>
Scopes of the application for which consent is granted.

Outputs

All input properties are implicitly available as output properties. Additionally, the AppOauthApiScope 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 str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing AppOauthApiScope Resource

Get an existing AppOauthApiScope 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?: AppOauthApiScopeState, opts?: CustomResourceOptions): AppOauthApiScope
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        app_id: Optional[str] = None,
        issuer: Optional[str] = None,
        scopes: Optional[Sequence[str]] = None) -> AppOauthApiScope
func GetAppOauthApiScope(ctx *Context, name string, id IDInput, state *AppOauthApiScopeState, opts ...ResourceOption) (*AppOauthApiScope, error)
public static AppOauthApiScope Get(string name, Input<string> id, AppOauthApiScopeState? state, CustomResourceOptions? opts = null)
public static AppOauthApiScope get(String name, Output<String> id, AppOauthApiScopeState state, CustomResourceOptions options)
resources:  _:    type: okta:AppOauthApiScope    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AppId Changes to this property will trigger replacement. string
ID of the application.
Issuer string
The issuer of your Org Authorization Server, your Org URL.
Scopes List<string>
Scopes of the application for which consent is granted.
AppId Changes to this property will trigger replacement. string
ID of the application.
Issuer string
The issuer of your Org Authorization Server, your Org URL.
Scopes []string
Scopes of the application for which consent is granted.
appId Changes to this property will trigger replacement. String
ID of the application.
issuer String
The issuer of your Org Authorization Server, your Org URL.
scopes List<String>
Scopes of the application for which consent is granted.
appId Changes to this property will trigger replacement. string
ID of the application.
issuer string
The issuer of your Org Authorization Server, your Org URL.
scopes string[]
Scopes of the application for which consent is granted.
app_id Changes to this property will trigger replacement. str
ID of the application.
issuer str
The issuer of your Org Authorization Server, your Org URL.
scopes Sequence[str]
Scopes of the application for which consent is granted.
appId Changes to this property will trigger replacement. String
ID of the application.
issuer String
The issuer of your Org Authorization Server, your Org URL.
scopes List<String>
Scopes of the application for which consent is granted.

Import

$ pulumi import okta:index/appOauthApiScope:AppOauthApiScope example <app_id>
Copy

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.