IotHubSasTokenWithRefreshAuthenticationProvider 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. IotHubSasTokenWithRefreshAuthenticationProvider
- com.
- com.
- com.
public abstract class IotHubSasTokenWithRefreshAuthenticationProvider
extends IotHubSasTokenAuthenticationProvider
Authentication method that uses a shared access signature token and allows for token refresh.
Constructor Summary
Modifier | Constructor | Description |
---|---|---|
protected | IotHubSasTokenWithRefreshAuthenticationProvider(String hostname, String gatewayHostName, String deviceId, String moduleId, String sharedAccessToken, int suggestedTimeToLiveSeconds, int timeBufferPercentage) |
Constructor for Iot |
Method Summary
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
buildAudience(String hostname, String deviceId, String moduleId)
Constructs the audience string to be used in a sas token |
char[] |
getSasToken()
Check if sas token should be renewed at all, and then renew it if necessary |
boolean |
isAuthenticationProviderRenewalNecessary()
Returns false as instances of this class will always be able to renew their own sas token |
abstract void |
refreshSasToken()
Renew the saved sas token |
Methods inherited from IotHubAuthenticationProvider
Methods inherited from IotHubSasTokenAuthenticationProvider
Methods inherited from java.lang.Object
Constructor Details
IotHubSasTokenWithRefreshAuthenticationProvider
protected IotHubSasTokenWithRefreshAuthenticationProvider(String hostname, String gatewayHostName, String deviceId, String moduleId, String sharedAccessToken, int suggestedTimeToLiveSeconds, int timeBufferPercentage)
Constructor for IotHubSasTokenWithRefreshAuthenticationProvider
Parameters:
Method Details
buildAudience
protected static String buildAudience(String hostname, String deviceId, String moduleId)
Constructs the audience string to be used in a sas token
Parameters:
Returns:
Throws:
getSasToken
public char[] getSasToken()
Check if sas token should be renewed at all, and then renew it if necessary
Overrides:
IotHubSasTokenWithRefreshAuthenticationProvider.getSasToken()Returns:
Throws:
isAuthenticationProviderRenewalNecessary
public boolean isAuthenticationProviderRenewalNecessary()
Returns false as instances of this class will always be able to renew their own sas token
Overrides:
IotHubSasTokenWithRefreshAuthenticationProvider.isAuthenticationProviderRenewalNecessary()Returns:
refreshSasToken
public abstract void refreshSasToken()
Renew the saved sas token
Throws:
Applies to
Azure SDK for Java