New-​Azure​Rm​Api​Management​Authorization​Server

Creates an authorization server.

Syntax

New-AzureRmApiManagementAuthorizationServer
   -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>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

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

Examples

Example 1: Create an authorization server

PS C:\>New-AzureRmApiManagementAuthrizarionServer -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.

Required Parameters

-AccessTokenSendingMethods

Specifies an array of methods to send an access token. The acceptable values for this parameter are: AuthorizationHeader and Query.

Type:PsApiManagementAccessTokenSendingMethod[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-AuthorizationEndpointUrl

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ClientAuthenticationMethods

Specifies an array of client authentication methods. The acceptable values for this parameter are: Basic and Body.

Type:PsApiManagementClientAuthenticationMethod[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ClientId

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ClientRegistrationPageUrl

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Context

Specifies a PsApiManagementContext object.

Type:PsApiManagementContext
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-GrantTypes

Specifies an array of grant types. The acceptable values for this parameter are:- AuthorizationCode

  • ClientCredentials
  • Implicit
  • ResourceOwnerPassword
Type:PsApiManagementGrantType[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the authorization server to create.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters: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.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-AuthorizationRequestMethods

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

Type:PsApiManagementAuthorizationRequestMethod[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ClientSecret

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DefaultScope

Specifies the default scope for the authorization server.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Description

Specifies a description for an authorization server.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-InformationAction

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceOwnerPassword

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceOwnerUsername

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServerId

Specifies the ID of the authorization server to create.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SupportState

Indicates whether to support the State parameter.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TokenBodyParameters

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

Type:Hashtable
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Outputs

Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementOAuth2AuthrozationServer