Main Content

matlab.net.http.AuthenticationScheme class

Package: 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.

If you send a message to a server that requires authentication, then the server returns a ResponseMessage 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.

Enumeration
Member 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 appropriate Credentials 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.

HOBA

Not support by MATLAB.

Mutual

Not support by MATLAB.

Negotiate

This scheme supports SPNEGO-based Kerberos and NTLM on Windows® only.

MATLAB implements this scheme automatically when you supply Credentials in HTTPOptions that name this scheme or which have an empty Scheme. A default HTTPOptions 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 and Password properties of the Credentials object.

NTLM

MATLAB implements this scheme automatically when you supply Credentials in HTTPOptions that name this scheme or which have an empty Scheme. A default HTTPOptions 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 and Password in the Credentials object.

OAuth

Not support by MATLAB.

Token

Not support by MATLAB.

Methods

expand all

Introduced in R2016b