setCustomLoginProvider
Description
setCustomLoginProvider(
registers a custom authentication callback function,
myClient,authenticationFunction)authenticationFunction, for the OSLC client object
myClient. You can use this function to authenticate an OSLC client
object on networks that require advanced authentication that the default authentication
process does not support.
Note
The custom authentication callback function should take this form:
function [success,cookies] = myCustomLoginProvider(server,options) % Provide your implementation here end
matlab.net.http.field.CookieField object.
Examples
Input Arguments
Tips
If your authentication process requires a particular set of HTTP options, you can either:
Construct a
matlab.net.http.HTTPOptionsobject and assign it to your OSLC client by usingsetHttpOptions, which passes the HTTP options to your custom authentication callback function.Construct the HTTP options internally in your custom authentication callback function.
If you want to preconfigure the login process with credentials or use a particular authentication scheme, you can create a
matlab.net.http.Credentialsobject and include it with amatlab.net.http.HTTPOptionsobject that you assign to the OSLC client object. For more information, see Server Authentication.Note
Depending on the authentication method used by your server, your custom authentication callback function might also have to satisfy authentication requirements. For example, you might have to mimic the form-based authentication required by your authentication server.
You can unregister all callbacks from an OSLC client object
myClientby entering:setCustomLoginProvider(myClient,'');
Version History
Introduced in R2021b