Class SharedAccessSignatureTokenProvider
- Namespace
- Microsoft.Azure.ServiceBus.Primitives
- Assembly
- Microsoft.Azure.ServiceBus.dll
The SharedAccessSignatureTokenProvider generates tokens using a shared access key or existing signature.
public class SharedAccessSignatureTokenProvider : TokenProvider, ITokenProvider
- Inheritance
-
SharedAccessSignatureTokenProvider
- Implements
- Inherited Members
Constructors
SharedAccessSignatureTokenProvider(string, string, Func<string, byte[]>, TimeSpan, TokenScope)
protected SharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, Func<string, byte[]> customKeyEncoder, TimeSpan tokenTimeToLive, TokenScope tokenScope)
Parameters
keyName
stringsharedAccessKey
stringcustomKeyEncoder
Func<string, byte[]>tokenTimeToLive
TimeSpantokenScope
TokenScope
Methods
BuildSignature(string)
protected virtual string BuildSignature(string targetUri)
Parameters
targetUri
string
Returns
GetTokenAsync(string, TimeSpan)
Gets a SecurityToken for the given audience and duration.
public override Task<SecurityToken> GetTokenAsync(string appliesTo, TimeSpan timeout)
Parameters
appliesTo
stringThe URI which the access token applies to. If SharedAccessSignatureTokenProvider is initiated with SASKeyName and SASKey, the token will be generated for this uri. If initiated with SASToken, then the value is ignored.
timeout
TimeSpanThe timeout value for how long it takes to get the security token (not the token time to live). For SAS token, no asynchronous operation takes place and hence this timeout is ignored.
Returns
Remarks
This parameter timeout
is here for compatibility, but is not currently used.