Class SoAccessToken
Class representing Access Tokens which are an alternative to Tickets. The access tokens are valid for a shorter time-period than tickets. AccessTokens restrict access to the installation by multiple criterias. The access is restricted to the permissions of the partner application and the associate. Compared to SoCredentials, the access tokens are more short-lived (1 hour).
Inherited Members
Namespace: SuperOffice.Security.Principal
Assembly: SoCore.dll
Syntax
public sealed class SoAccessToken
Constructors
SoAccessToken()
Class representing Access Tokens which are an alternative to Tickets. The access tokens are valid for a shorter time-period than tickets. AccessTokens restrict access to the installation by multiple criterias. The access is restricted to the permissions of the partner application and the associate. Compared to SoCredentials, the access tokens are more short-lived (1 hour).
Declaration
public SoAccessToken()
Fields
AccessTokenPrefix
Class representing Access Tokens which are an alternative to Tickets. The access tokens are valid for a shorter time-period than tickets. AccessTokens restrict access to the installation by multiple criterias. The access is restricted to the permissions of the partner application and the associate. Compared to SoCredentials, the access tokens are more short-lived (1 hour).
Declaration
public const string AccessTokenPrefix = "8A:"
Field Value
Type | Description |
---|---|
string |
ClaimType
Class representing Access Tokens which are an alternative to Tickets. The access tokens are valid for a shorter time-period than tickets. AccessTokens restrict access to the installation by multiple criterias. The access is restricted to the permissions of the partner application and the associate. Compared to SoCredentials, the access tokens are more short-lived (1 hour).
Declaration
public const string ClaimType = "http://schemes.superoffice.net/identity/8t_access_token"
Field Value
Type | Description |
---|---|
string |
Properties
ApplicationToken
Application Token identifiying the partner application.
Declaration
public string ApplicationToken { get; set; }
Property Value
Type | Description |
---|---|
string |
AssociateId
The identifier of the associate used when creating the access token.
Declaration
public int AssociateId { get; set; }
Property Value
Type | Description |
---|---|
int |
ContextIdentifier
The contextIdentifier in the access token.
Declaration
public string ContextIdentifier { get; set; }
Property Value
Type | Description |
---|---|
string |
LoginId
Class representing Access Tokens which are an alternative to Tickets. The access tokens are valid for a shorter time-period than tickets. AccessTokens restrict access to the installation by multiple criterias. The access is restricted to the permissions of the partner application and the associate. Compared to SoCredentials, the access tokens are more short-lived (1 hour).
Declaration
public int LoginId { get; set; }
Property Value
Type | Description |
---|---|
int |
Nonce
Class representing Access Tokens which are an alternative to Tickets. The access tokens are valid for a shorter time-period than tickets. AccessTokens restrict access to the installation by multiple criterias. The access is restricted to the permissions of the partner application and the associate. Compared to SoCredentials, the access tokens are more short-lived (1 hour).
Declaration
public string Nonce { get; set; }
Property Value
Type | Description |
---|---|
string |
SessionKey
Class representing Access Tokens which are an alternative to Tickets. The access tokens are valid for a shorter time-period than tickets. AccessTokens restrict access to the installation by multiple criterias. The access is restricted to the permissions of the partner application and the associate. Compared to SoCredentials, the access tokens are more short-lived (1 hour).
Declaration
public string SessionKey { get; set; }
Property Value
Type | Description |
---|---|
string |
UserId
Class representing Access Tokens which are an alternative to Tickets. The access tokens are valid for a shorter time-period than tickets. AccessTokens restrict access to the installation by multiple criterias. The access is restricted to the permissions of the partner application and the associate. Compared to SoCredentials, the access tokens are more short-lived (1 hour).
Declaration
public int UserId { get; set; }
Property Value
Type | Description |
---|---|
int |
ValidFrom
ValidFrom and ValidTo restrict the period when the access token is valid.
Declaration
public DateTime ValidFrom { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
ValidTo
ValidFrom and ValidTo restrict the period when the access token is valid.
Declaration
public DateTime ValidTo { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
Methods
CreateDefault(string, uint)
Class representing Access Tokens which are an alternative to Tickets. The access tokens are valid for a shorter time-period than tickets. AccessTokens restrict access to the installation by multiple criterias. The access is restricted to the permissions of the partner application and the associate. Compared to SoCredentials, the access tokens are more short-lived (1 hour).
Declaration
public static SoAccessToken CreateDefault(string applicationToken, uint expiresIn)
Parameters
Type | Name | Description |
---|---|---|
string | applicationToken | |
uint | expiresIn |
Returns
Type | Description |
---|---|
SoAccessToken |
CreateNonce()
Class representing Access Tokens which are an alternative to Tickets. The access tokens are valid for a shorter time-period than tickets. AccessTokens restrict access to the installation by multiple criterias. The access is restricted to the permissions of the partner application and the associate. Compared to SoCredentials, the access tokens are more short-lived (1 hour).
Declaration
public static string CreateNonce()
Returns
Type | Description |
---|---|
string |
GetUntrustedContextIdentifier(string)
Get the untrusted contextIdentifier. The value of the contextIdentifier can be changed without detection.
Declaration
public static string GetUntrustedContextIdentifier(string accessToken)
Parameters
Type | Name | Description |
---|---|---|
string | accessToken |
Returns
Type | Description |
---|---|
string |
IsAccessTokenPrefix(string)
Check if a user name is an access token. See if it starts with the AccessTokenPrefix
Declaration
public static bool IsAccessTokenPrefix(string userName)
Parameters
Type | Name | Description |
---|---|---|
string | userName | 8A:base64-encoded-encrypted-signed-value |
Returns
Type | Description |
---|---|
bool | True if the user name is an access token |
TryParse(string, out string, out string)
Try parse the encrypted version of the access token into the contextIdentifier and the encrypted data.
Declaration
public static bool TryParse(string accessToken, out string contextIdentifier, out string tokenData)
Parameters
Type | Name | Description |
---|---|---|
string | accessToken | The encrypted and encoded version of the access token. |
string | contextIdentifier | The contextIdentifier found in the access token |
string | tokenData | The encrypted oayload in the token. |
Returns
Type | Description |
---|---|
bool |