IotHubSasTokenProvidedAuthenticationProvider Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. auth. IotHubAuthenticationProvider - com.
microsoft. azure. sdk. iot. device. auth. IotHubSasTokenAuthenticationProvider - com.
microsoft. azure. sdk. iot. device. auth. IotHubSasTokenProvidedAuthenticationProvider
- com.
- com.
- com.
public class IotHubSasTokenProvidedAuthenticationProvider
extends IotHubSasTokenAuthenticationProvider
IotHubSasTokenAuthenticationProvider implementation where the tokens are provided by an instance of SasTokenProvider. This is used in cases like when the user creates a device client with com.microsoft.azure.sdk.iot.device.DeviceClient#DeviceClient(String, String, SasTokenProvider, IotHubClientProtocol, ClientOptions)
Constructor Summary
Constructor | Description | |
---|---|---|
IotHubSasTokenProvidedAuthenticationProvider(String hostName, String deviceId, String moduleId, SasTokenProvider sasTokenProvider, SSLContext sslContext) |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean | canRefreshToken() |
int | getMillisecondsBeforeProactiveRenewal() |
char[] | getSasToken() |
boolean |
isAuthenticationProviderRenewalNecessary()
Returns true if the this authentication provider is no longer valid. |
void | setTokenValidSecs(long tokenValidSecs) |
Methods inherited from IotHubAuthenticationProvider
Methods inherited from IotHubSasTokenAuthenticationProvider
Methods inherited from java.lang.Object
Constructor Details
IotHubSasTokenProvidedAuthenticationProvider
public IotHubSasTokenProvidedAuthenticationProvider(String hostName, String deviceId, String moduleId, SasTokenProvider sasTokenProvider, SSLContext sslContext)
Parameters:
Method Details
canRefreshToken
public boolean canRefreshToken()
Overrides:
IotHubSasTokenProvidedAuthenticationProvider.canRefreshToken()getMillisecondsBeforeProactiveRenewal
public int getMillisecondsBeforeProactiveRenewal()
Overrides:
IotHubSasTokenProvidedAuthenticationProvider.getMillisecondsBeforeProactiveRenewal()getSasToken
public char[] getSasToken()
Overrides:
IotHubSasTokenProvidedAuthenticationProvider.getSasToken()isAuthenticationProviderRenewalNecessary
public boolean isAuthenticationProviderRenewalNecessary()
Returns true if the this authentication provider is no longer valid. If true, users will need to create a new DeviceClient instance to get a new authentication provider. The most common case for this is if the user provides a SAS token, but no symmetric key, and that SAS token has expired. At that point, the user's client won't be able to authenticate anymore.
Overrides:
IotHubSasTokenProvidedAuthenticationProvider.isAuthenticationProviderRenewalNecessary()setTokenValidSecs
public void setTokenValidSecs(long tokenValidSecs)
Overrides:
IotHubSasTokenProvidedAuthenticationProvider.setTokenValidSecs(long tokenValidSecs)Parameters:
Applies to
Azure SDK for Java