Table of Contents

Class TokenCredential

Namespace
Microsoft.WindowsAzure.Storage.Auth
Assembly
Microsoft.WindowsAzure.Storage.dll

Represents a token that is used to authorize HTTPS requests.

public sealed class TokenCredential : IDisposable
Inheritance
TokenCredential
Implements
Inherited Members

Constructors

TokenCredential(string)

Create an instance of TokenCredential.

public TokenCredential(string initialToken)

Parameters

initialToken string

Initial value of the token credential.

TokenCredential(string, RenewTokenFuncAsync, object, TimeSpan)

Create an instance of TokenCredential.

public TokenCredential(string initialToken, RenewTokenFuncAsync periodicTokenRenewer, object state, TimeSpan renewFrequency)

Parameters

initialToken string

Initial value of the token credential.

periodicTokenRenewer RenewTokenFuncAsync

If given, this delegate is called periodically to renew the token credential.

state object

A state object is passed to the periodicTokenRenewer every time it is called.

renewFrequency TimeSpan

If periodicTokenRenewer is given, user should define a frequency to call the periodicTokenRenewer.

Properties

Token

The authorization token. It can be set by the user at any point in a thread-safe way.

public string Token { get; set; }

Property Value

string

Methods

Dispose()

Calling Dispose stops the timer and periodicTokenRenewer.

public void Dispose()