Table of Contents

Class SharedSecretTokenProvider

Namespace
Microsoft.ServiceBus
Assembly
Microsoft.ServiceBus.dll

Provides methods that return name/value pairs for web token assertions, and that execute asynchronous shared secret token retrieval operations.

public class SharedSecretTokenProvider : TokenProvider
Inheritance
SharedSecretTokenProvider
Inherited Members

Methods

BuildKey(string, string)

Generates a key for the token provider.

protected override TokenProvider.Key BuildKey(string appliesTo, string action)

Parameters

appliesTo string

The URI which the access token applies to.

action string

The request action.

Returns

TokenProvider.Key

A generated key for the token provider.

ComputeSimpleWebTokenString(string, byte[])

Returns a string of URL encoded name/value pairs for a simple web token assertion using the specified issuer name and issuer secret.

public static string ComputeSimpleWebTokenString(string issuerName, byte[] issuerSecret)

Parameters

issuerName string

The issuer name.

issuerSecret byte[]

The issuer secret.

Returns

string

A URL encoded name/value pairs for a simple web token assertion.

ComputeSimpleWebTokenString(string, string)

Returns a string of URL encoded name/value pairs for a simple web token assertion using the specified issuer name and issuer secret.

public static string ComputeSimpleWebTokenString(string issuerName, string issuerSecret)

Parameters

issuerName string

The issuer name.

issuerSecret string

The issuer secret.

Returns

string

A URL encoded name/value pairs for a simple web token assertion.

OnBeginGetToken(string, string, TimeSpan, AsyncCallback, object)

Executes the begin get token action.

protected override IAsyncResult OnBeginGetToken(string appliesTo, string action, TimeSpan timeout, AsyncCallback callback, object state)

Parameters

appliesTo string

The URI which the access token applies to.

action string

The request action.

timeout TimeSpan

The time span that specifies the timeout value for the message that gets the security token.

callback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state object

A user-defined object that contains state information about the asynchronous operation.

Returns

IAsyncResult

An IAsyncResult object that references the asynchronous operation to get a token.

OnBeginGetWebToken(string, string, TimeSpan, AsyncCallback, object)

Executes the begin get web token action.

protected override IAsyncResult OnBeginGetWebToken(string appliesTo, string action, TimeSpan timeout, AsyncCallback callback, object state)

Parameters

appliesTo string

The URI which the access token applies to.

action string

The request action.

timeout TimeSpan

The time span that specifies the timeout value for the message that gets the security token.

callback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state object

A user-defined object that contains state information about the asynchronous operation.

Returns

IAsyncResult

An IAsyncResult object that references the asynchronous operation to get a web token.

OnEndGetToken(IAsyncResult, out DateTime)

Executes the end get token action.

protected override SecurityToken OnEndGetToken(IAsyncResult result, out DateTime cacheUntil)

Parameters

result IAsyncResult

An IAsyncResult object that references the asynchronous operation to get a token.

cacheUntil DateTime

When this method returns, contains the expiration date and time of the token information in the cache.

Returns

SecurityToken

The security token.

OnEndGetWebToken(IAsyncResult, out DateTime)

Executes the end get web token action.

protected override string OnEndGetWebToken(IAsyncResult result, out DateTime cacheUntil)

Parameters

result IAsyncResult

An IAsyncResult object that references the asynchronous operation to get a web token.

cacheUntil DateTime

When this method returns, contains the expiration date and time of the token information in the cache.

Returns

string

The web token.