AuthorizationServerArgs

data class AuthorizationServerArgs(val authorizationEndpoint: Output<String>? = null, val authorizationMethods: Output<List<AuthorizationMethod>>? = null, val authsid: Output<String>? = null, val bearerTokenSendingMethods: Output<List<Either<String, BearerTokenSendingMethod>>>? = null, val clientAuthenticationMethod: Output<List<Either<String, ClientAuthenticationMethod>>>? = null, val clientId: Output<String>? = null, val clientRegistrationEndpoint: Output<String>? = null, val clientSecret: Output<String>? = null, val defaultScope: Output<String>? = null, val description: Output<String>? = null, val displayName: Output<String>? = null, val grantTypes: Output<List<Either<String, GrantType>>>? = null, val resourceGroupName: Output<String>? = null, val resourceOwnerPassword: Output<String>? = null, val resourceOwnerUsername: Output<String>? = null, val serviceName: Output<String>? = null, val supportState: Output<Boolean>? = null, val tokenBodyParameters: Output<List<TokenBodyParameterContractArgs>>? = null, val tokenEndpoint: Output<String>? = null, val useInApiDocumentation: Output<Boolean>? = null, val useInTestConsole: Output<Boolean>? = null) : ConvertibleToJava<AuthorizationServerArgs>

External OAuth authorization server settings. Uses Azure REST API version 2022-09-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-08-01. Other available API versions: 2021-04-01-preview, 2021-08-01, 2021-12-01-preview, 2022-04-01-preview, 2022-08-01, 2023-03-01-preview, 2023-05-01-preview, 2023-09-01-preview, 2024-05-01, 2024-06-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native apimanagement [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

ApiManagementCreateAuthorizationServer

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var authorizationServer = new AzureNative.ApiManagement.AuthorizationServer("authorizationServer", new()
{
AuthorizationEndpoint = "https://www.contoso.com/oauth2/auth",
AuthorizationMethods = new[]
{
AzureNative.ApiManagement.AuthorizationMethod.GET,
},
Authsid = "newauthServer",
BearerTokenSendingMethods = new[]
{
AzureNative.ApiManagement.BearerTokenSendingMethod.AuthorizationHeader,
},
ClientId = "1",
ClientRegistrationEndpoint = "https://www.contoso.com/apps",
ClientSecret = "2",
DefaultScope = "read write",
Description = "test server",
DisplayName = "test2",
GrantTypes = new[]
{
AzureNative.ApiManagement.GrantType.AuthorizationCode,
AzureNative.ApiManagement.GrantType.@Implicit,
},
ResourceGroupName = "rg1",
ResourceOwnerPassword = "pwd",
ResourceOwnerUsername = "un",
ServiceName = "apimService1",
SupportState = true,
TokenEndpoint = "https://www.contoso.com/oauth2/token",
UseInApiDocumentation = true,
UseInTestConsole = false,
});
});
package main
import (
apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apimanagement.NewAuthorizationServer(ctx, "authorizationServer", &apimanagement.AuthorizationServerArgs{
AuthorizationEndpoint: pulumi.String("https://www.contoso.com/oauth2/auth"),
AuthorizationMethods: apimanagement.AuthorizationMethodArray{
apimanagement.AuthorizationMethodGET,
},
Authsid: pulumi.String("newauthServer"),
BearerTokenSendingMethods: pulumi.StringArray{
pulumi.String(apimanagement.BearerTokenSendingMethodAuthorizationHeader),
},
ClientId: pulumi.String("1"),
ClientRegistrationEndpoint: pulumi.String("https://www.contoso.com/apps"),
ClientSecret: pulumi.String("2"),
DefaultScope: pulumi.String("read write"),
Description: pulumi.String("test server"),
DisplayName: pulumi.String("test2"),
GrantTypes: pulumi.StringArray{
pulumi.String(apimanagement.GrantTypeAuthorizationCode),
pulumi.String(apimanagement.GrantTypeImplicit),
},
ResourceGroupName: pulumi.String("rg1"),
ResourceOwnerPassword: pulumi.String("pwd"),
ResourceOwnerUsername: pulumi.String("un"),
ServiceName: pulumi.String("apimService1"),
SupportState: pulumi.Bool(true),
TokenEndpoint: pulumi.String("https://www.contoso.com/oauth2/token"),
UseInApiDocumentation: pulumi.Bool(true),
UseInTestConsole: pulumi.Bool(false),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.apimanagement.AuthorizationServer;
import com.pulumi.azurenative.apimanagement.AuthorizationServerArgs;
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 authorizationServer = new AuthorizationServer("authorizationServer", AuthorizationServerArgs.builder()
.authorizationEndpoint("https://www.contoso.com/oauth2/auth")
.authorizationMethods("GET")
.authsid("newauthServer")
.bearerTokenSendingMethods("authorizationHeader")
.clientId("1")
.clientRegistrationEndpoint("https://www.contoso.com/apps")
.clientSecret("2")
.defaultScope("read write")
.description("test server")
.displayName("test2")
.grantTypes(
"authorizationCode",
"implicit")
.resourceGroupName("rg1")
.resourceOwnerPassword("pwd")
.resourceOwnerUsername("un")
.serviceName("apimService1")
.supportState(true)
.tokenEndpoint("https://www.contoso.com/oauth2/token")
.useInApiDocumentation(true)
.useInTestConsole(false)
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:apimanagement:AuthorizationServer newauthServer /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}

Constructors

Link copied to clipboard
constructor(authorizationEndpoint: Output<String>? = null, authorizationMethods: Output<List<AuthorizationMethod>>? = null, authsid: Output<String>? = null, bearerTokenSendingMethods: Output<List<Either<String, BearerTokenSendingMethod>>>? = null, clientAuthenticationMethod: Output<List<Either<String, ClientAuthenticationMethod>>>? = null, clientId: Output<String>? = null, clientRegistrationEndpoint: Output<String>? = null, clientSecret: Output<String>? = null, defaultScope: Output<String>? = null, description: Output<String>? = null, displayName: Output<String>? = null, grantTypes: Output<List<Either<String, GrantType>>>? = null, resourceGroupName: Output<String>? = null, resourceOwnerPassword: Output<String>? = null, resourceOwnerUsername: Output<String>? = null, serviceName: Output<String>? = null, supportState: Output<Boolean>? = null, tokenBodyParameters: Output<List<TokenBodyParameterContractArgs>>? = null, tokenEndpoint: Output<String>? = null, useInApiDocumentation: Output<Boolean>? = null, useInTestConsole: Output<Boolean>? = null)

Properties

Link copied to clipboard
val authorizationEndpoint: Output<String>? = null

OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.

Link copied to clipboard

HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.

Link copied to clipboard
val authsid: Output<String>? = null

Identifier of the authorization server.

Link copied to clipboard

Specifies the mechanism by which access token is passed to the API.

Link copied to clipboard

Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format.

Link copied to clipboard
val clientId: Output<String>? = null

Client or app id registered with this authorization server.

Link copied to clipboard
val clientRegistrationEndpoint: Output<String>? = null

Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.

Link copied to clipboard
val clientSecret: Output<String>? = null

Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.

Link copied to clipboard
val defaultScope: Output<String>? = null

Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values.

Link copied to clipboard
val description: Output<String>? = null

Description of the authorization server. Can contain HTML formatting tags.

Link copied to clipboard
val displayName: Output<String>? = null

User-friendly authorization server name.

Link copied to clipboard
val grantTypes: Output<List<Either<String, GrantType>>>? = null

Form of an authorization grant, which the client uses to request the access token.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

Link copied to clipboard
val resourceOwnerPassword: Output<String>? = null

Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.

Link copied to clipboard
val resourceOwnerUsername: Output<String>? = null

Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.

Link copied to clipboard
val serviceName: Output<String>? = null

The name of the API Management service.

Link copied to clipboard
val supportState: Output<Boolean>? = null

If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security.

Link copied to clipboard

Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}.

Link copied to clipboard
val tokenEndpoint: Output<String>? = null

OAuth token endpoint. Contains absolute URI to entity being referenced.

Link copied to clipboard
val useInApiDocumentation: Output<Boolean>? = null

If true, the authorization server will be used in the API documentation in the developer portal. False by default if no value is provided.

Link copied to clipboard
val useInTestConsole: Output<Boolean>? = null

If true, the authorization server may be used in the developer portal test console. True by default if no value is provided.

Functions

Link copied to clipboard
open override fun toJava(): AuthorizationServerArgs