TokenProvider TokenProvider Class

Definition

Represents a security token provider with built-in factory methods returning some well-known token providers.

public abstract class TokenProviderPublic MustInherit Class TokenProvider
Inheritance
TokenProviderTokenProvider
Derived

Inherited Members

System.Object

Constructors

TokenProvider(Boolean, Boolean) TokenProvider(Boolean, Boolean)

Initializes a new instance of the TokenProvider class.

protected TokenProvider(bool cacheTokens, bool supportHttpAuthToken)Protected Sub New(cacheTokens As Boolean, supportHttpAuthToken As Boolean)
Parameters
cacheTokens
Boolean Boolean

true if new security tokens are being cached; otherwise, false.

supportHttpAuthToken
Boolean Boolean

true if web token is supported by this provider; otherwise, false.

TokenProvider(Boolean, Boolean, TokenScope) TokenProvider(Boolean, Boolean, TokenScope)

Initializes a new instance of the TokenProvider class.

protected TokenProvider(bool cacheTokens, bool supportHttpAuthToken, TokenScope tokenScope)Protected Sub New(cacheTokens As Boolean, supportHttpAuthToken As Boolean, tokenScope As TokenScope)
Parameters
cacheTokens
Boolean Boolean

true if new security tokens are being cached; otherwise, false.

supportHttpAuthToken
Boolean Boolean

true if web token is supported by this provider; otherwise, false.

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

TokenProvider(Boolean, Boolean, Int32, TokenScope) TokenProvider(Boolean, Boolean, Int32, TokenScope)

Initializes a new instance of the TokenProvider class.

protected TokenProvider(bool cacheTokens, bool supportHttpAuthToken, int cacheSize, TokenScope tokenScope)Protected Sub New(cacheTokens As Boolean, supportHttpAuthToken As Boolean, cacheSize As Integer, tokenScope As TokenScope)
Parameters
cacheTokens
Boolean Boolean

true if new security tokens are being cached; otherwise, false.

supportHttpAuthToken
Boolean Boolean

true if web token is supported by this provider; otherwise, false.

cacheSize
Int32 Int32

The size of the cache.

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Properties

CacheSize CacheSize

Gets or sets the size of the cache.

public int CacheSize { get; set; }Public Property CacheSize As Integer
Value
Int32 Int32

The size of the cache.

CacheTokens CacheTokens

Gets or sets a value that indicates whether new security tokens are being cached.

public bool CacheTokens { get; set; }Public Property CacheTokens As Boolean
Value
Boolean Boolean

true if new security tokens are being cached; otherwise, false.

IsWebTokenSupported IsWebTokenSupported

Gets or sets a value that indicates whether web token is supported by this provider.

public bool IsWebTokenSupported { get; }Public ReadOnly Property IsWebTokenSupported As Boolean
Value
Boolean Boolean

true if web token is supported by this provider; otherwise, false.

StripQueryParameters StripQueryParameters

Gets whether the token provider strips query parameters.

protected virtual bool StripQueryParameters { get; }Protected Overridable ReadOnly Property StripQueryParameters As Boolean
Value
Boolean Boolean

true if the token provider strips query parameters; otherwise, false.

TokenScope TokenScope

Gets or sets the token scope associated with the provider.

public TokenScope TokenScope { get; }Public ReadOnly Property TokenScope As TokenScope
Value
TokenScope TokenScope

The token scope associated with the provider.

Methods

BeginGetToken(String, String, Boolean, TimeSpan, AsyncCallback, Object) BeginGetToken(String, String, Boolean, TimeSpan, AsyncCallback, Object)

Begins an asynchronous operation to get a security token.

public IAsyncResult BeginGetToken(string appliesTo, string action, bool bypassCache, TimeSpan timeout, AsyncCallback callback, object state)Public Function BeginGetToken(appliesTo As String, action As String, bypassCache As Boolean, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
appliesTo
String String

The URI which the access token applies to.

action
String String

The request action.

bypassCache
Boolean Boolean

true to ignore existing token information in the cache; false to use the token information in the cache.

timeout
TimeSpan TimeSpan

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

callback
AsyncCallback AsyncCallback

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

state
Object Object

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

Returns

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

BeginGetWebToken(String, String, Boolean, TimeSpan, AsyncCallback, Object) BeginGetWebToken(String, String, Boolean, TimeSpan, AsyncCallback, Object)

Begins an asynchronous operation to get a web token.

public IAsyncResult BeginGetWebToken(string appliesTo, string action, bool bypassCache, TimeSpan timeout, AsyncCallback callback, object state)Public Function BeginGetWebToken(appliesTo As String, action As String, bypassCache As Boolean, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
appliesTo
String String

The URI which the token applies to.

action
String String

The request action.

bypassCache
Boolean Boolean

true to ignore existing token information in the cache; false to use the token information in the cache.

timeout
TimeSpan TimeSpan

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

callback
AsyncCallback AsyncCallback

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

state
Object Object

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

Returns

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

BuildKey(String, String) BuildKey(String, String)

Generates a key for the token provider.

protected virtual TokenProvider.Key BuildKey(string appliesTo, string action)Protected Overridable Function BuildKey(appliesTo As String, action As String) As TokenProvider.Key
Parameters
appliesTo
String String

The URI which the access token applies to.

action
String String

The request action.

Returns

A generated key for the token provider.

Clear() Clear()

Clears the token provider.

public void Clear()Public Sub Clear

CreateOAuthTokenProvider(IEnumerable<Uri>, NetworkCredential) CreateOAuthTokenProvider(IEnumerable(Of Uri), NetworkCredential)

Creates an OAuth (open standard for authorization) token provider.

public static TokenProvider CreateOAuthTokenProvider(IEnumerable<Uri> stsUris, NetworkCredential credential)Public Shared Function CreateOAuthTokenProvider(stsUris As IEnumerable(Of Uri), credential As NetworkCredential) As TokenProvider
Parameters
stsUris
IEnumerable<Uri> IEnumerable(Of Uri)

The URIs of the Security Token Service (STS).

credential
NetworkCredential NetworkCredential

The user credential.

Returns

The TokenProvider for returning OAuth token.

CreateSamlTokenProvider(String) CreateSamlTokenProvider(String)

Creates a SAML token provider with the specified SAML token.

public static TokenProvider CreateSamlTokenProvider(string samlToken)Public Shared Function CreateSamlTokenProvider(samlToken As String) As TokenProvider
Parameters
samlToken
String String

The string that represents the SAML token.

Returns

The TokenProvider for returning SAML token.

CreateSamlTokenProvider(String, TokenScope) CreateSamlTokenProvider(String, TokenScope)

Creates a SAML token provider with the specified SAML token and scope.

public static TokenProvider CreateSamlTokenProvider(string samlToken, TokenScope tokenScope)Public Shared Function CreateSamlTokenProvider(samlToken As String, tokenScope As TokenScope) As TokenProvider
Parameters
samlToken
String String

The string that represents the SAML token.

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The TokenProvider for returning SAML token.

CreateSamlTokenProvider(String, Uri) CreateSamlTokenProvider(String, Uri)

Creates a SAML token provider with the specified SAML token and URI of the Security Token Service (STS).

public static TokenProvider CreateSamlTokenProvider(string samlToken, Uri stsUri)Public Shared Function CreateSamlTokenProvider(samlToken As String, stsUri As Uri) As TokenProvider
Parameters
samlToken
String String

The string that represents the SAML token.

stsUri
Uri Uri

The URI of the Security Token Service (STS).

Returns

The TokenProvider for returning SAML token.

CreateSamlTokenProvider(String, Uri, TokenScope) CreateSamlTokenProvider(String, Uri, TokenScope)

Creates a SAML token provider with the specified SAML token, URI of the Security Token Service (STS) and token scope.

public static TokenProvider CreateSamlTokenProvider(string samlToken, Uri stsUri, TokenScope tokenScope)Public Shared Function CreateSamlTokenProvider(samlToken As String, stsUri As Uri, tokenScope As TokenScope) As TokenProvider
Parameters
samlToken
String String

The string that represents the SAML token.

stsUri
Uri Uri

The URI of the Security Token Service (STS).

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The TokenProvider for returning SAML token.

CreateSamlTokenProvider(String, Uri, Int32) CreateSamlTokenProvider(String, Uri, Int32)

Creates a SAML token provider with the specified SAML token, URI of the Security Token Service (STS) and cache size.

public static TokenProvider CreateSamlTokenProvider(string samlToken, Uri stsUri, int cacheSize)Public Shared Function CreateSamlTokenProvider(samlToken As String, stsUri As Uri, cacheSize As Integer) As TokenProvider
Parameters
samlToken
String String

The string that represents the SAML token.

stsUri
Uri Uri

The URI of the Security Token Service (STS).

cacheSize
Int32 Int32

The size of the cache.

Returns

The TokenProvider for returning SAML token.

CreateSamlTokenProvider(String, Uri, Int32, TokenScope) CreateSamlTokenProvider(String, Uri, Int32, TokenScope)

Creates a SAML token provider with the specified SAML token, URI of the Security Token Service (STS), cache size and token scope.

public static TokenProvider CreateSamlTokenProvider(string samlToken, Uri stsUri, int cacheSize, TokenScope tokenScope)Public Shared Function CreateSamlTokenProvider(samlToken As String, stsUri As Uri, cacheSize As Integer, tokenScope As TokenScope) As TokenProvider
Parameters
samlToken
String String

The string that represents the SAML token.

stsUri
Uri Uri

The URI of the Security Token Service (STS).

cacheSize
Int32 Int32

The size of the cache.

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The TokenProvider for returning SAML token.

CreateSharedAccessSignatureTokenProvider(String) CreateSharedAccessSignatureTokenProvider(String)

Creates a URL that grants access to the token provider with the specified shared access signature.

public static TokenProvider CreateSharedAccessSignatureTokenProvider(string sharedAccessSignature)Public Shared Function CreateSharedAccessSignatureTokenProvider(sharedAccessSignature As String) As TokenProvider
Parameters
sharedAccessSignature
String String

The shared access signature.

Returns

CreateSharedAccessSignatureTokenProvider(String, String) CreateSharedAccessSignatureTokenProvider(String, String)

Creates a URL that grants access to the token provider with the specified key name and shared access key.

public static TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey)Public Shared Function CreateSharedAccessSignatureTokenProvider(keyName As String, sharedAccessKey As String) As TokenProvider
Parameters
keyName
String String

The key name.

sharedAccessKey
String String

The shared access key.

Returns

The created URL that grants access to token provider.

CreateSharedAccessSignatureTokenProvider(String, String, TokenScope) CreateSharedAccessSignatureTokenProvider(String, String, TokenScope)

Creates a URL that grants access to the token provider with the specified key name, shared access key and token scope.

public static TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, TokenScope tokenScope)Public Shared Function CreateSharedAccessSignatureTokenProvider(keyName As String, sharedAccessKey As String, tokenScope As TokenScope) As TokenProvider
Parameters
keyName
String String

The key name.

sharedAccessKey
String String

The shared access key.

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The created URL that grants access to token provider.

CreateSharedAccessSignatureTokenProvider(String, String, TimeSpan) CreateSharedAccessSignatureTokenProvider(String, String, TimeSpan)

Creates a URL that grants access to the token provider with the specified key name, shared access key and token time to live.

public static TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, TimeSpan tokenTimeToLive)Public Shared Function CreateSharedAccessSignatureTokenProvider(keyName As String, sharedAccessKey As String, tokenTimeToLive As TimeSpan) As TokenProvider
Parameters
keyName
String String

The key name.

sharedAccessKey
String String

The shared access key.

tokenTimeToLive
TimeSpan TimeSpan

The time for which the operation remains valid.

Returns

The created URL that grants access to token provider.

CreateSharedAccessSignatureTokenProvider(String, String, TimeSpan, TokenScope) CreateSharedAccessSignatureTokenProvider(String, String, TimeSpan, TokenScope)

Creates a URL that grants access to the token provider.

public static TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, TimeSpan tokenTimeToLive, TokenScope tokenScope)Public Shared Function CreateSharedAccessSignatureTokenProvider(keyName As String, sharedAccessKey As String, tokenTimeToLive As TimeSpan, tokenScope As TokenScope) As TokenProvider
Parameters
keyName
String String

The key name.

sharedAccessKey
String String

The shared access key.

tokenTimeToLive
TimeSpan TimeSpan

The time for which the operation remains valid.

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The created URL that grants access to token provider.

CreateSharedSecretTokenProvider(String, Byte[]) CreateSharedSecretTokenProvider(String, Byte())

Creates a shared secret token provider.

public static TokenProvider CreateSharedSecretTokenProvider(string issuerName, byte[] issuerSecret)Public Shared Function CreateSharedSecretTokenProvider(issuerName As String, issuerSecret As Byte()) As TokenProvider
Parameters
issuerName
String String

The issuer name.

issuerSecret
Byte[] Byte()

The issuer secret.

Returns

The TokenProvider for returning shared secret token.

CreateSharedSecretTokenProvider(String, Byte[], TokenScope) CreateSharedSecretTokenProvider(String, Byte(), TokenScope)

Creates a shared secret token provider.

public static TokenProvider CreateSharedSecretTokenProvider(string issuerName, byte[] issuerSecret, TokenScope tokenScope)Public Shared Function CreateSharedSecretTokenProvider(issuerName As String, issuerSecret As Byte(), tokenScope As TokenScope) As TokenProvider
Parameters
issuerName
String String

The name of the issuer.

issuerSecret
Byte[] Byte()

The set of issuer secret.

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The created token provider.

CreateSharedSecretTokenProvider(String, Byte[], Uri) CreateSharedSecretTokenProvider(String, Byte(), Uri)

Creates a shared secret token provider.

public static TokenProvider CreateSharedSecretTokenProvider(string issuerName, byte[] issuerSecret, Uri stsUri)Public Shared Function CreateSharedSecretTokenProvider(issuerName As String, issuerSecret As Byte(), stsUri As Uri) As TokenProvider
Parameters
issuerName
String String

The issuer name.

issuerSecret
Byte[] Byte()

The set of issuer secret.

stsUri
Uri Uri

The URI of the Security Token Service (STS).

Returns

The TokenProvider for returning shared secret token.

CreateSharedSecretTokenProvider(String, Byte[], Uri, TokenScope) CreateSharedSecretTokenProvider(String, Byte(), Uri, TokenScope)

Creates a shared secret token provider.

public static TokenProvider CreateSharedSecretTokenProvider(string issuerName, byte[] issuerSecret, Uri stsUri, TokenScope tokenScope)Public Shared Function CreateSharedSecretTokenProvider(issuerName As String, issuerSecret As Byte(), stsUri As Uri, tokenScope As TokenScope) As TokenProvider
Parameters
issuerName
String String

The issuer name.

issuerSecret
Byte[] Byte()

The set of issuer secret.

stsUri
Uri Uri

The Security Token Service's endpoint Uri.

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The created token provider.

CreateSharedSecretTokenProvider(String, String) CreateSharedSecretTokenProvider(String, String)

Creates a shared secret token provider.

public static TokenProvider CreateSharedSecretTokenProvider(string issuerName, string issuerSecret)Public Shared Function CreateSharedSecretTokenProvider(issuerName As String, issuerSecret As String) As TokenProvider
Parameters
issuerName
String String

The issuer name.

issuerSecret
String String

The issuer secret.

Returns

The TokenProvider for returning shared secret token.

CreateSharedSecretTokenProvider(String, String, TokenScope) CreateSharedSecretTokenProvider(String, String, TokenScope)

Creates a shared secret token provider.

public static TokenProvider CreateSharedSecretTokenProvider(string issuerName, string issuerSecret, TokenScope tokenScope)Public Shared Function CreateSharedSecretTokenProvider(issuerName As String, issuerSecret As String, tokenScope As TokenScope) As TokenProvider
Parameters
issuerName
String String

The issuer name.

issuerSecret
String String

The issuer secret.

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The created token provider.

CreateSharedSecretTokenProvider(String, String, Uri) CreateSharedSecretTokenProvider(String, String, Uri)

Creates a shared secret token provider.

public static TokenProvider CreateSharedSecretTokenProvider(string issuerName, string issuerSecret, Uri stsUri)Public Shared Function CreateSharedSecretTokenProvider(issuerName As String, issuerSecret As String, stsUri As Uri) As TokenProvider
Parameters
issuerName
String String

The issuer name.

issuerSecret
String String

The issuer secret.

stsUri
Uri Uri

The URI of the Security Token Service (STS).

Returns

The TokenProvider for returning shared secret token.

CreateSharedSecretTokenProvider(String, String, Uri, TokenScope) CreateSharedSecretTokenProvider(String, String, Uri, TokenScope)

Creates a shared secret token provider.

public static TokenProvider CreateSharedSecretTokenProvider(string issuerName, string issuerSecret, Uri stsUri, TokenScope tokenScope)Public Shared Function CreateSharedSecretTokenProvider(issuerName As String, issuerSecret As String, stsUri As Uri, tokenScope As TokenScope) As TokenProvider
Parameters
issuerName
String String

The issuer name.

issuerSecret
String String

The issuer secret.

stsUri
Uri Uri

The URI of the Security Token Service (STS).

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The created token provider.

CreateSimpleWebTokenProvider(String) CreateSimpleWebTokenProvider(String)

Creates a simple web token provider.

public static TokenProvider CreateSimpleWebTokenProvider(string token)Public Shared Function CreateSimpleWebTokenProvider(token As String) As TokenProvider
Parameters
token
String String

The string that represents the simple web token.

Returns

The TokenProvider for returning simple web token.

CreateSimpleWebTokenProvider(String, TokenScope) CreateSimpleWebTokenProvider(String, TokenScope)

Creates a simple web token provider.

public static TokenProvider CreateSimpleWebTokenProvider(string token, TokenScope tokenScope)Public Shared Function CreateSimpleWebTokenProvider(token As String, tokenScope As TokenScope) As TokenProvider
Parameters
token
String String

The string that represents the simple web token.

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The created simple web token provider.

CreateSimpleWebTokenProvider(String, Uri) CreateSimpleWebTokenProvider(String, Uri)

Creates a simple web token provider.

public static TokenProvider CreateSimpleWebTokenProvider(string token, Uri stsUri)Public Shared Function CreateSimpleWebTokenProvider(token As String, stsUri As Uri) As TokenProvider
Parameters
token
String String

The string that represents the simple web token.

stsUri
Uri Uri

The URI of the Security Token Service (STS).

Returns

The TokenProvider for returning simple web token.

CreateSimpleWebTokenProvider(String, Uri, TokenScope) CreateSimpleWebTokenProvider(String, Uri, TokenScope)

Creates a simple web token provider.

public static TokenProvider CreateSimpleWebTokenProvider(string token, Uri stsUri, TokenScope tokenScope)Public Shared Function CreateSimpleWebTokenProvider(token As String, stsUri As Uri, tokenScope As TokenScope) As TokenProvider
Parameters
token
String String

The string that represents the simple web token.

stsUri
Uri Uri

The URI of the Security Token Service (STS).

tokenScope
TokenScope TokenScope

The token scope associated with the provider.

Returns

The created simple web token provider.

CreateWindowsTokenProvider(IEnumerable<Uri>) CreateWindowsTokenProvider(IEnumerable(Of Uri))

Creates a windows token provider.

public static TokenProvider CreateWindowsTokenProvider(IEnumerable<Uri> stsUris)Public Shared Function CreateWindowsTokenProvider(stsUris As IEnumerable(Of Uri)) As TokenProvider
Parameters
stsUris
IEnumerable<Uri> IEnumerable(Of Uri)

The URIs of the Security Token Service (STS).

Returns

The TokenProvider for returning the windows token.

CreateWindowsTokenProvider(IEnumerable<Uri>, NetworkCredential) CreateWindowsTokenProvider(IEnumerable(Of Uri), NetworkCredential)

Creates a windows token provider.

public static TokenProvider CreateWindowsTokenProvider(IEnumerable<Uri> stsUris, NetworkCredential credential)Public Shared Function CreateWindowsTokenProvider(stsUris As IEnumerable(Of Uri), credential As NetworkCredential) As TokenProvider
Parameters
stsUris
IEnumerable<Uri> IEnumerable(Of Uri)

The URIs of the Security Token Service (STS).

credential
NetworkCredential NetworkCredential

The user credential.

Returns

The TokenProvider for returning the windows token.

EndGetToken(IAsyncResult) EndGetToken(IAsyncResult)

Completes an asynchronous operation to get a security token.

public SecurityToken EndGetToken(IAsyncResult result)Public Function EndGetToken(result As IAsyncResult) As SecurityToken
Parameters
result
IAsyncResult IAsyncResult

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

Returns

EndGetWebToken(IAsyncResult) EndGetWebToken(IAsyncResult)

Completes an asynchronous operation to get a web token.

public string EndGetWebToken(IAsyncResult result)Public Function EndGetWebToken(result As IAsyncResult) As String
Parameters
result
IAsyncResult IAsyncResult

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

Returns

The String that represents the web token.

GetTokenAsync(String, String, Boolean, TimeSpan) GetTokenAsync(String, String, Boolean, TimeSpan)

Asynchronously retrieves the token for the provider.

public Task<SecurityToken> GetTokenAsync(string appliesTo, string action, bool bypassCache, TimeSpan timeout)Public Function GetTokenAsync(appliesTo As String, action As String, bypassCache As Boolean, timeout As TimeSpan) As Task(Of SecurityToken)
Parameters
appliesTo
String String

The URI which the access token applies to.

action
String String

The request action.

bypassCache
Boolean Boolean

true to ignore existing token information in the cache; false to use the token information in the cache.

timeout
TimeSpan TimeSpan

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

Returns

The result of the asynchronous operation.

GetWebTokenAsync(String, String, Boolean, TimeSpan) GetWebTokenAsync(String, String, Boolean, TimeSpan)

Asynchronously retrieves the web token for the provider.

public Task<string> GetWebTokenAsync(string appliesTo, string action, bool bypassCache, TimeSpan timeout)Public Function GetWebTokenAsync(appliesTo As String, action As String, bypassCache As Boolean, timeout As TimeSpan) As Task(Of String)
Parameters
appliesTo
String String

The URI which the access token applies to.

action
String String

The request action.

bypassCache
Boolean Boolean

true to ignore existing token information in the cache; false to use the token information in the cache.

timeout
TimeSpan TimeSpan

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

Returns

The result of the asynchronous operation.

NormalizeAppliesTo(String) NormalizeAppliesTo(String)

Returns an object whose value is the same as the token provider.

protected virtual string NormalizeAppliesTo(string appliesTo)Protected Overridable Function NormalizeAppliesTo(appliesTo As String) As String
Parameters
appliesTo
String String

The URI which the access token applies to.

Returns

The returned object.

OnBeginGetToken(String, String, TimeSpan, AsyncCallback, Object) OnBeginGetToken(String, String, TimeSpan, AsyncCallback, Object)

Executes upon calling the BeginGetToken method.

protected abstract IAsyncResult OnBeginGetToken(string appliesTo, string action, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginGetToken(appliesTo As String, action As String, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
appliesTo
String String

The URI which the access token applies to.

action
String String

The request action.

timeout
TimeSpan TimeSpan

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

callback
AsyncCallback AsyncCallback

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

state
Object Object

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

Returns

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

OnBeginGetWebToken(String, String, TimeSpan, AsyncCallback, Object) OnBeginGetWebToken(String, String, TimeSpan, AsyncCallback, Object)

Executes upon calling the BeginGetWebToken method.

protected abstract IAsyncResult OnBeginGetWebToken(string appliesTo, string action, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginGetWebToken(appliesTo As String, action As String, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
appliesTo
String String

The URI which the access token applies to.

action
String String

The request action.

timeout
TimeSpan TimeSpan

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

callback
AsyncCallback AsyncCallback

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

state
Object Object

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

Returns

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

OnEndGetToken(IAsyncResult, out DateTime) OnEndGetToken(IAsyncResult, ByRef DateTime)

Executes upon calling the EndGetToken method.

protected abstract SecurityToken OnEndGetToken(IAsyncResult result, out DateTime cacheUntil)Protected MustOverride Function OnEndGetToken(result As IAsyncResult, ByRef cacheUntil As Date) As SecurityToken
Parameters
result
IAsyncResult IAsyncResult

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

cacheUntil
DateTime DateTime

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

Returns

OnEndGetWebToken(IAsyncResult, out DateTime) OnEndGetWebToken(IAsyncResult, ByRef DateTime)

Executes upon calling the EndGetWebToken method.

protected abstract string OnEndGetWebToken(IAsyncResult result, out DateTime cacheUntil)Protected MustOverride Function OnEndGetWebToken(result As IAsyncResult, ByRef cacheUntil As Date) As String
Parameters
result
IAsyncResult IAsyncResult

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

cacheUntil
DateTime DateTime

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

Returns

The String that represents the web token.