public class IotHubSasTokenSoftwareAuthenticationProvider extends IotHubSasTokenAuthenticationProvider
sasToken, tokenValidSecsdeviceId, gatewayHostname, hostname, moduleId| Constructor and Description |
|---|
IotHubSasTokenSoftwareAuthenticationProvider(java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String deviceId,
java.lang.String moduleId,
java.lang.String deviceKey,
java.lang.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
|
IotHubSasTokenSoftwareAuthenticationProvider(java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String deviceId,
java.lang.String moduleId,
java.lang.String deviceKey,
java.lang.String sharedAccessToken,
int tokenValidSecs,
int timeBufferPercentage)
Constructor that takes a connection string containing a sas token or a device key
|
IotHubSasTokenSoftwareAuthenticationProvider(java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String deviceId,
java.lang.String moduleId,
java.lang.String deviceKey,
java.lang.String sharedAccessToken,
javax.net.ssl.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
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRefreshToken() |
char[] |
getSasToken()
Getter for SasToken.
|
boolean |
isAuthenticationProviderRenewalNecessary()
Returns true if the saved sas token has expired and cannot be auto-renewed through the device key
|
void |
setTokenValidSecs(long tokenValidSecs) |
getMillisecondsBeforeProactiveRenewal, getTokenValidSecs, isSasTokenExpired, shouldRefreshTokengetDeviceId, getGatewayHostname, getHostname, getModuleId, getSSLContextpublic IotHubSasTokenSoftwareAuthenticationProvider(java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String deviceId,
java.lang.String moduleId,
java.lang.String deviceKey,
java.lang.String sharedAccessToken,
int tokenValidSecs,
int timeBufferPercentage)
hostname - the IotHub host namegatewayHostname - The gateway hostname to use, or null if connecting to an IotHubdeviceId - the IotHub device idmoduleId - the module id. May be null if not using a moduledeviceKey - the device key for the device. Must be null if the provided sharedAccessToken is notsharedAccessToken - the sas token string for accessing the device. Must be null if the provided deviceKey is not.tokenValidSecs - the number of seconds that the token will be valid fortimeBufferPercentage - the percent of the sas token's life that will be exhausted before renewal is attemptedpublic IotHubSasTokenSoftwareAuthenticationProvider(java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String deviceId,
java.lang.String moduleId,
java.lang.String deviceKey,
java.lang.String sharedAccessToken)
hostname - the IotHub host namegatewayHostname - The gateway hostname to use, or null if connecting to an IotHubdeviceId - the IotHub device idmoduleId - the module id. May be null if not using a moduledeviceKey - the device key for the device. Must be null if the provided sharedAccessToken is notsharedAccessToken - the sas token string for accessing the device. Must be null if the provided deviceKey is not.public IotHubSasTokenSoftwareAuthenticationProvider(java.lang.String hostname,
java.lang.String gatewayHostname,
java.lang.String deviceId,
java.lang.String moduleId,
java.lang.String deviceKey,
java.lang.String sharedAccessToken,
javax.net.ssl.SSLContext sslContext)
hostname - the IotHub host namegatewayHostname - The gateway hostname to use, or null if connecting to an IotHubdeviceId - the IotHub device idmoduleId - the module id. May be null if not using a moduledeviceKey - the device key for the device. Must be null if the provided sharedAccessToken is notsharedAccessToken - the sas token string for accessing the device. Must be null if the provided deviceKey is not.sslContext - the sslContext to use for SSL negotiationpublic boolean isAuthenticationProviderRenewalNecessary()
isAuthenticationProviderRenewalNecessary in class IotHubSasTokenAuthenticationProviderpublic void setTokenValidSecs(long tokenValidSecs)
setTokenValidSecs in class IotHubSasTokenAuthenticationProviderpublic boolean canRefreshToken()
canRefreshToken in class IotHubSasTokenAuthenticationProviderpublic char[] getSasToken()
getSasToken in class IotHubSasTokenAuthenticationProviderCopyright © 2023. All rights reserved.