IotHubSasTokenSoftwareAuthenticationProvider 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. IotHubSasTokenSoftwareAuthenticationProvider
- com.
- com.
- com.
public class IotHubSasTokenSoftwareAuthenticationProvider
extends IotHubSasTokenAuthenticationProvider
Field Summary
Modifier and Type | Field and Description |
---|---|
protected java.lang.String | deviceKey |
Constructor Summary
Constructor | Description |
---|---|
IotHubSasTokenSoftwareAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, String deviceKey, String sharedAccessToken) |
Constructor that takes a connection string containing a sas token or a device key and uses the default token valid seconds and time |
IotHubSasTokenSoftwareAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, String deviceKey, String sharedAccessToken, int tokenValidSecs, int timeBufferPercentage) |
Constructor that takes a connection string containing a sas token or a device key |
IotHubSasTokenSoftwareAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, String deviceKey, String sharedAccessToken, SSLContext sslContext) |
Constructor that takes a connection string containing a sas token or a device key and uses the default token valid seconds and time |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean | canRefreshToken() |
char[] |
getSasToken()
Getter for Sas |
boolean |
isAuthenticationProviderRenewalNecessary()
Returns true if the saved sas token has expired and cannot be auto-renewed through the device key |
void | setTokenValidSecs(long tokenValidSecs) |
Methods inherited from IotHubAuthenticationProvider
Methods inherited from IotHubSasTokenAuthenticationProvider
Methods inherited from java.lang.Object
Field Details
deviceKey
protected String deviceKey
Constructor Details
IotHubSasTokenSoftwareAuthenticationProvider
public IotHubSasTokenSoftwareAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, String deviceKey, String sharedAccessToken)
Constructor that takes a connection string containing a sas token or a device key and uses the default token valid seconds and timeBufferPercentage
Parameters:
Throws:
IotHubSasTokenSoftwareAuthenticationProvider
public IotHubSasTokenSoftwareAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, String deviceKey, String sharedAccessToken, int tokenValidSecs, int timeBufferPercentage)
Constructor that takes a connection string containing a sas token or a device key
Parameters:
Throws:
IotHubSasTokenSoftwareAuthenticationProvider
public IotHubSasTokenSoftwareAuthenticationProvider(String hostname, String gatewayHostname, String deviceId, String moduleId, String deviceKey, String sharedAccessToken, SSLContext sslContext)
Constructor that takes a connection string containing a sas token or a device key and uses the default token valid seconds and timeBufferPercentage
Parameters:
Throws:
Method Details
canRefreshToken
public boolean canRefreshToken()
Overrides:
IotHubSasTokenSoftwareAuthenticationProvider.canRefreshToken()getSasToken
public char[] getSasToken()
Getter for SasToken. If the saved token has expired, this method shall renew it if possible
Overrides:
IotHubSasTokenSoftwareAuthenticationProvider.getSasToken()Returns:
Throws:
isAuthenticationProviderRenewalNecessary
public boolean isAuthenticationProviderRenewalNecessary()
Returns true if the saved sas token has expired and cannot be auto-renewed through the device key
Overrides:
IotHubSasTokenSoftwareAuthenticationProvider.isAuthenticationProviderRenewalNecessary()Returns:
setTokenValidSecs
public void setTokenValidSecs(long tokenValidSecs)
Overrides:
IotHubSasTokenSoftwareAuthenticationProvider.setTokenValidSecs(long tokenValidSecs)Parameters:
Applies to
Azure SDK for Java