EnsureAuthenticated¶
Authenticates the client with the specified service and scope if not already authenticated.
1 |
|
Authenticates the client with the specified service and scope if not already authenticated.
1 |
|
Authenticates the client with the specified service, scope, and identity if not already authenticated.
1 |
|
Parameters¶
string service
The name of the service to authenticate with.
string scope
The scope of the authentication context.
( string | Identity ) identity
The identity to impersonate. Can be an Identity instance or its ID.
Returns¶
The current RestClient instance. The current RestClient instance. The current RestClient instance.
Remarks¶
The scope of authentication is based on the service
parameter. Refer to the service documentation for details.
This method attempts server-to-server authentication if configured for the service. Otherwise, user consent must have been previously granted.
If authentication fails, an error is thrown. Use a try-catch block to handle potential authentication failures.
Example¶
1 2 3 4 5 |
|
The scope of authentication is based on the service
parameter. Refer to the service documentation for details.
This method attempts server-to-server authentication if configured for the service. Otherwise, user consent must have been previously granted.
If authentication fails, an error is thrown. Use a try-catch block to handle potential authentication failures.
Example¶
1 2 3 4 5 |
|
The scope of authentication is based on the service
parameter. Refer to the service documentation for details.
This method attempts server-to-server authentication if configured for the service. Otherwise, user consent must have been previously granted.
If authentication fails, an error is thrown. Use a try-catch block to handle potential authentication failures.
Example¶
1 2 3 4 5 |
|