prodserver.addon.accessTokenPolicy
Syntax
Description
prodserver.addon.accessTokenPolicy(
sets the Azure® Active Directory (Azure AD) credentials for user authorization using one or more name-value arguments
and sets a token generation policy to authorize a user that is using MATLAB®
Production Server™ add-ons to communicate with a server running at
host
,port
,token
,Name,Value
)host
:
port
.
This function requires MATLAB Client for MATLAB Production Server.
Examples
Use System-Generated Bearer Token
To use a system-generated bearer token, you must set the Azure AD app registration credentials using name-value arguments.
First, make sure that access control is enabled on the server. For more information, see Application Access Control.
Make sure that the MATLAB Production Server add-on of the deployed application is installed on the client machine. For more information about installing add-ons, see Execute Deployed MATLAB Functions.
Set the system to automatically generate the bearer token to use in requests to a
server running at localhost
and port 57142, and also specify
Azure AD app registration credentials for user authorization.
prodserver.addon.accessTokenPolicy('localhost',57142,'automatic',... 'ClientID','0d912326-e439-41d0-822c-b15asdf6137c3',... 'ServerID','dwe4581bf-7867-4b90-a05a-16be6a82flkh',... 'IssuerURI','https://login.microsoftonline.com/yourcompany.com')
Typically, you set the Azure AD app registration credentials once per server instance.
Specify Bearer Token
Specify a bearer token to use when communicating with a server.
First, enable access control on the server. For more information, see Application Access Control.
Make sure that the MATLAB Production Server add-on of the deployed application is installed on the client machine. For more information about installing add-ons, see Execute Deployed MATLAB Functions.
Specify the bearer token 'bearer_token_value'
to use in requests
to a server running at IP address 10.2.2.5 and port
57142.
prodserver.addon.accessTokenPolicy('10.2.2.5',57142,'bearer_token_value')
Do Not Generate Token
Specify that no bearer token is required when access control is not enabled on a server.
Make sure that the MATLAB Production Server add-on of the deployed application is installed on the client machine. For more information about installing add-ons, see Execute Deployed MATLAB Functions.
Set the system to not generate a bearer token to use in requests to a server running at IP address 10.2.2.5 and port 57142.
prodserver.addon.accessTokenPolicy('10.2.2.5',57142,'none')
Input Arguments
host
— Host name of server
character vector | string scalar
Host name of the server hosting a deployable archive from which the add-on is installed, specified as a character vector or string scalar.
Example: '144.213.5.7'
Data Types: char
| string
port
— Port number of server
positive scalar
Port number of the server hosting a deployable archive from which the add-on is installed, specified as a positive scalar.
Example: 9920
Data Types: uint8
| uint16
token
— Access token policy
'none' (default) | 'automatic' | character vector | string scalar
Access token policy, specified as a character vector or string scalar. Set a token generation policy or specify a bearer token to authorize a user when communicating with a server. Possible options follow:
'automatic'
— Generate bearer tokens using user credentials of the user logged in to the client machine. Azure AD app registration credentials must be set to use this policy.'none'
— Do not generate an access token. This value is the default.Character vector or string scalar — Specify a value to use as the bearer token.
If access control is enabled on the server, you must set the policy to
'automatic'
or specify a bearer token.
Example: 'automatic'
Example: 'none'
Example: 'AAAAAAAAAABBBBAAAAAAAMLheAAAAAAA0%2BuSepl%2BULvsea4JtiGRiSDSJSI%3DEUifiRmndf5E2XzMDjRfl76ZC9Ub0wnz4XsNiRVBChTYbJcE3F'
Data Types: char
| string
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'ClientID','d17lk1bf-7977-4c90-a95a-16by7982fbaf', 'ServerID',
'd7pj91bf-7977-4b90-a05a-17vy5s82fbaf','IssuerURI','https://login.microsoftonline.com/your_organization_tenantID'
ClientID
— Application ID of Azure AD client app
character vector | string scalar
Application ID of the client app registered in Azure AD used for user authorization, specified as a character vector or string scalar.
Example: 'ClientID','d17lk1bf-7977-4c90-a95a-16by7982fbaf'
Data Types: char
| string
ServerID
— Application ID of the Azure AD server app
character vector | string scalar
Application ID of the server app registered in Azure AD used for user authorization, specified as a character vector or string scalar.
Example: 'ServerID','d7pj91bf-7977-4b90-a05a-17vy5s82fbaf'
Data Types: char
| string
IssuerURI
— URI to generate token
character vector | string scalar
URI to generate a bearer token, specified as a character vector or string scalar.
For Azure AD, the IssuerURI
is
https://login.microsoftonline.com/
followed by the Azure AD tenant ID.
Example: 'IssuerURI','https://login.microsoftonline.com/your_organization_tenantID'
Data Types: char
| string
Version History
Introduced in R2020b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)