Class SecurityTokens
The security tokens for a user of an app and methods for reading and writing them in the client's container in Azure storage
Inheritance
Inherited Members
Namespace:AzureFunctionsForSharePoint.Core
Assembly:AzureFunctionsForSharePoint.Core.dll
Syntax
public class SecurityTokens
Properties
| Improve this Doc View SourceAccessToken
Access token for connecting to SP
Declaration
public string AccessToken { get; set; }
Property Value
Type | Description |
---|---|
System.String |
AccessTokenExpires
Historically unreliable indicator of when the token expires
Declaration
public DateTime AccessTokenExpires { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
AppWebUrl
The web to which the tokens apply
Declaration
public string AppWebUrl { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ClientId
The client to which the tokens apply
Declaration
public string ClientId { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Realm
The host part of the app web URL
Declaration
public string Realm { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RefreshToken
Refresh token used to get a new access token
Declaration
public string RefreshToken { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceGetSecurityTokens(String, String)
Gets the tokens from storage based on the app's config file
Declaration
public static SecurityTokens GetSecurityTokens(string cacheKey, string clientId)
Parameters
Type | Name | Description |
---|---|---|
System.String | cacheKey | The user's cache key |
System.String | clientId | The client id |
Returns
Type | Description |
---|---|
SecurityTokens | The tokens |
GetSecurityTokens(String, String, String, String)
Gets the tokens from storage
Declaration
public static SecurityTokens GetSecurityTokens(string cacheKey, string clientId, string storageAccount, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | cacheKey | The user's cache key |
System.String | clientId | The client id |
System.String | storageAccount | The storage account |
System.String | storageKey | The storage account key |
Returns
Type | Description |
---|---|
SecurityTokens | The tokens |
StoreSecurityTokens(SecurityTokens, String)
Saves the tokens to storage based on the app's config file
Declaration
public static void StoreSecurityTokens(SecurityTokens tokens, string cacheKey)
Parameters
Type | Name | Description |
---|---|---|
SecurityTokens | tokens | The tokens to save |
System.String | cacheKey | The user's cache key |
StoreSecurityTokens(SecurityTokens, String, String, String)
Saves the tokens to storage
Declaration
public static void StoreSecurityTokens(SecurityTokens tokens, string cacheKey, string storageAccount, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
SecurityTokens | tokens | The tokens |
System.String | cacheKey | The user's cache key |
System.String | storageAccount | The storage account |
System.String | storageKey | The storage account key |