Edit

Share via


New-AzApiManagementAuthorizationServer

Creates an authorization server.

Syntax

Default (Default)

New-AzApiManagementAuthorizationServer
    -Context <PsApiManagementContext>
    [-ServerId <String>]
    -Name <String>
    [-Description <String>]
    -ClientRegistrationPageUrl <String>
    -AuthorizationEndpointUrl <String>
    -TokenEndpointUrl <String>
    -ClientId <String>
    [-ClientSecret <String>]
    [-AuthorizationRequestMethods <PsApiManagementAuthorizationRequestMethod[]>]
    -GrantTypes <PsApiManagementGrantType[]>
    -ClientAuthenticationMethods <PsApiManagementClientAuthenticationMethod[]>
    [-TokenBodyParameters <Hashtable>]
    [-SupportState <Boolean>]
    [-DefaultScope <String>]
    -AccessTokenSendingMethods <PsApiManagementAccessTokenSendingMethod[]>
    [-ResourceOwnerUsername <String>]
    [-ResourceOwnerPassword <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The New-AzApiManagementAuthorizationServer cmdlet creates an Azure API Management authorization server.

Examples

Example 1: Create an authorization server

$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
New-AzApiManagementAuthorizationServer -Context $ApiMgmtContext -Name "Contoso OAuth2 server" -ClientRegistrationPageUrl "https://contoso/signup" -AuthorizationEndpointUrl "https://contoso/auth" -TokenEndpointUrl "https://contoso/token" -ClientId "clientid" -ClientSecret "e041ed1b660b4eadbad5a29d066e6e88" -AuthorizationRequestMethods @('Get', 'Post') -GrantTypes @( 'AuthorizationCode', 'Implicit', 'ResourceOwnerPassword', 'ClientCredentials') -ClientAuthenticationMethods @('Basic') -TokenBodyParameters @{'par1'='val1'; 'par2'='val2'} -AccessTokenSendingMethods @('AuthorizationHeader', 'Query') -ResourceOwnerUsername "ivan" -ResourceOwnerPassword "qwerty"

This command creates an authorization server.

Example 2

Creates an authorization server. (autogenerated)

New-AzApiManagementAuthorizationServer -AccessTokenSendingMethods AuthorizationHeader -AuthorizationEndpointUrl 'https://contoso/auth' -AuthorizationRequestMethods Get -ClientAuthenticationMethods Basic -ClientId 'clientid' -ClientRegistrationPageUrl 'https://contoso/signup' -ClientSecret '0000000000000000000000000000000000000' -Context <PsApiManagementContext> -GrantTypes AuthorizationCode -Name 'Contoso OAuth2 server' -ServerId '0123456789' -TokenBodyParameters @{'par1'='val1'} -TokenEndpointUrl 'https://contoso/token'

Parameters

-AccessTokenSendingMethods

Specifies an array of methods to send an access token. psdx_paramvalues AuthorizationHeader and Query.

Parameter properties

Type:

PsApiManagementAccessTokenSendingMethod[]

Default value:None
Accepted values:AuthorizationHeader, Query
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-AuthorizationEndpointUrl

Specifies the authorization endpoint to authenticate resource owners and obtain authorization grants.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-AuthorizationRequestMethods

Specifies an array of authorization request methods. Valid values are: GET, POST. The default value is GET.

Parameter properties

Type:

PsApiManagementAuthorizationRequestMethod[]

Default value:None
Accepted values:Get, Post, Head, Options, Trace, Put, Patch, Delete
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ClientAuthenticationMethods

Specifies an array of client authentication methods. psdx_paramvalues Basic and Body.

Parameter properties

Type:

PsApiManagementClientAuthenticationMethod[]

Default value:None
Accepted values:Basic, Body
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ClientId

Specifies the client ID of the developer console that is the client application.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ClientRegistrationPageUrl

Specifies the client registration endpoint to register clients with the authorization server and obtain client credentials.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ClientSecret

Specifies the client secret of developer console that is the client application.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Context

Specifies a PsApiManagementContext object.

Parameter properties

Type:PsApiManagementContext
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultScope

Specifies the default scope for the authorization server.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Description

Specifies a description for an authorization server.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-GrantTypes

Specifies an array of grant types. psdx_paramvalues

  • AuthorizationCode
  • ClientCredentials
  • Implicit
  • ResourceOwnerPassword

Parameter properties

Type:

PsApiManagementGrantType[]

Default value:None
Accepted values:AuthorizationCode, Implicit, ResourceOwnerPassword, ClientCredentials
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies the name of the authorization server to create.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceOwnerPassword

Specifies the resource owner password. You must specify this parameter is required if ResourceOwnerPassword is specified by the GrantTypes parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceOwnerUsername

Specifies the resource owner user name. You must specify this parameter if ResourceOwnerPassword is specified by the GrantTypes parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ServerId

Specifies the ID of the authorization server to create.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SupportState

Indicates whether to support the State parameter.

Parameter properties

Type:

Nullable<T>[Boolean]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TokenBodyParameters

Specifies additional body parameters using application/x-www-form-urlencoded format.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TokenEndpointUrl

Specifies the token endpoint URL that is used by clients to obtain access tokens in exchange for presenting authorization grants or refresh tokens.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PsApiManagementContext

String

PsApiManagementAuthorizationRequestMethod

PsApiManagementGrantType

PsApiManagementClientAuthenticationMethod

Hashtable

Nullable<T>

PsApiManagementAccessTokenSendingMethod

Outputs

PsApiManagementOAuth2AuthorizationServer