IotHubSasTokenWithRefreshAuthenticationProvider Class
- java.
lang. Object - IotHubAuthenticationProvider
- IotHubSasTokenAuthenticationProvider
- com.
microsoft. azure. sdk. iot. device. auth. IotHubSasTokenWithRefreshAuthenticationProvider
- com.
public class IotHubSasTokenWithRefreshAuthenticationProvider extends IotHubSasTokenAuthenticationProvider
Authentication method that uses a shared access signature token and allows for token refresh.
Constructor Summary
Constructor | Description |
---|---|
IotHubSasTokenWithRefreshAuthenticationProvider(String hostname, String gatewayHostName, String deviceId, String moduleId, String sharedAccessToken, int suggestedTimeToLiveSeconds, int timeBufferPercentage) |
Constructor for IotHubSasTokenWithRefreshAuthenticationProvider |
IotHubSasTokenWithRefreshAuthenticationProvider(String hostname, String gatewayHostName, String deviceId, String moduleId, String sharedAccessToken, int suggestedTimeToLiveSeconds, int timeBufferPercentage, SSLContext sslContext) |
Constructor for IotHubSasTokenWithRefreshAuthenticationProvider |
Method Summary
Modifier and Type | Method and Description |
---|---|
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 |
Inherited Members
Constructor Details
IotHubSasTokenWithRefreshAuthenticationProvider
protected IotHubSasTokenWithRefreshAuthenticationProvider(String hostname, String gatewayHostName, String deviceId, String moduleId, String sharedAccessToken, int suggestedTimeToLiveSeconds, int timeBufferPercentage)
Constructor for IotHubSasTokenWithRefreshAuthenticationProvider
Parameters:
IotHubSasTokenWithRefreshAuthenticationProvider
protected IotHubSasTokenWithRefreshAuthenticationProvider(String hostname, String gatewayHostName, String deviceId, String moduleId, String sharedAccessToken, int suggestedTimeToLiveSeconds, int timeBufferPercentage, SSLContext sslContext)
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
Returns:
Throws:
isAuthenticationProviderRenewalNecessary
public boolean isAuthenticationProviderRenewalNecessary()
Returns false as instances of this class will always be able to renew their own sas token
Returns:
refreshSasToken
public abstract void refreshSasToken()
Renew the saved sas token
Throws:
Applies to
Azure SDK for Java