matlab.net.http.AuthenticationScheme - HTTP Authentication scheme - MATLAB (original) (raw)
Main Content
Namespace: matlab.net.http
HTTP Authentication scheme
Description
The AuthenticationScheme
enumeration class provides identifiers for supported authentication schemes. To specify a scheme, add a Scheme property to a Credentials object. For more information, see RFC 2617 HTTP Authentication: Basic and Digest Access Authentication on the RFC Editor website.
If you send a message to a server that requires authentication, then the server returns aResponseMessage with a StatusCode of 401 or 407. The AuthenticateField in the response specifies the required AuthenticationSchemes
for the request. Choose the strongest of the schemes that you can support, and reissue the request with an AuthorizationField containing the appropriate authorization information.
If MATLAB® does not implement a scheme automatically and you want to use the scheme, then you must implement your own challenge responses.
EnumerationMember Name | Description |
---|---|
Basic | User name and password are transmitted in the header of an HTTP message. This scheme is implemented automatically when you supply the appropriateCredentials property in an HTTPOptions object when sending a message, and the server requests Basic authentication. |
Digest | User is authenticated with a name and password, but more secure because the password is not transmitted over the connection. This scheme is implemented automatically when you supply the appropriate Credentials property in an HTTPOptions object when sending a message, and the server requests Digest authentication. |
Bearer | Based on OAuth. MATLAB does not support this scheme using a Credentials object. For examples using a token in a request header field, see Add Bearer Token to Header Fields. |
HOBA | Not supported by MATLAB. |
Mutual | Not supported by MATLAB. |
Negotiate | This scheme supports SPNEGO-based Kerberos and NTLM on Windows® only.MATLAB implements this scheme automatically when you supplyCredentials in HTTPOptions that name this scheme or which have an empty Scheme. A defaultHTTPOptions object contains such a Credentials object. To use this scheme, you must be properly logged into a Kerberos or NTLM environment. This scheme ignores the Username andPassword properties of the Credentials object. |
NTLM | MATLAB implements this scheme automatically when you supplyCredentials in HTTPOptions that name this scheme or which have an empty Scheme. A defaultHTTPOptions object contains such a Credentials object. To use this scheme:On Windows platforms, you must be properly logged into an NTLM environment, and the Username and Password properties of the Credentials object are ignored.On Linux® and macOS platforms, you must specify the Username andPassword in the Credentials object. |
OAuth | Not supported by MATLAB. However, you can create the specific header fields required byOAuth. |
Token | Not supported by MATLAB. |
Methods
These methods specialize standard MATLAB operators and functions for objects in this class.
string | Authentication scheme as string |
---|---|
char | Authentication scheme as character vector |
Version History
Introduced in R2016b