Table of Contents

Class AuthenticationResult

Namespace
PolarStudio
Assembly
PolarStudio.dll

This class is used to communicate the result of an authentication request.

public class AuthenticationResult
Inheritance
AuthenticationResult
Inherited Members
Extension Methods

Constructors

AuthenticationResult()

Constructor to create a new empty AuthenticationResult object.

public AuthenticationResult()

AuthenticationResult(string)

Constructor to create an AuthenticationResult object based on a string. This can be a JSON string (as created by AuthenticationResult.GetJSON() ) or an old style string. This old style string is addedd for backwards compatibility but does not support all features/properties.

public AuthenticationResult(string pInitString)

Parameters

pInitString string

AuthenticationResult(string, string, string, string, string, string)

Constructor to easily create a new AuthenticationResult object with access to one application.

public AuthenticationResult(string pUserID, string pFullName, string pApplicationPID = "", string pGroupPID = "", string pPrivateRecordID = "", string pApplicationAccessGUID = "")

Parameters

pUserID string

The UserID used to log in. Does not necessarily have to match the used UserID, but can also be something like 'Guest'

pFullName string

The full name of the user

pApplicationPID string

The PID of the application this user gets access to in the application. Can also be '*' to give access to the first application.

pGroupPID string

The PID of the group

pPrivateRecordID string

An ID of the Private Record (when the UserGroup is linked to a table in the database)

pApplicationAccessGUID string

The GUID of the ApplicationAccess. The ApplicationAccess is used to store usersettings on the server for this specific application.

Fields

Applications

The Applications collections contains the applications within the project the user is allowed to use.

public Collection<AuthenticationResult_AllowedApplication> Applications

Field Value

Collection<AuthenticationResult_AllowedApplication>

ChangePasswordRequired

This flag will force the user to change the password. The user cannot continue using the application without successfully changing the password.

public bool ChangePasswordRequired

Field Value

bool

ChangePasswordRequired_PasswordExpiryTimeUTC

This DateTime can be set to allow setting the password (for some time) whithout specifying the old password. For example when the user has just logged on and then instantly has to set a new password.

public DateTime ChangePasswordRequired_PasswordExpiryTimeUTC

Field Value

DateTime

DefaultLanguageID

The ID of the default language to use.

public int DefaultLanguageID

Field Value

int

FullName

The full name of the user, like John Doe

public string FullName

Field Value

string

GUID

The GUID is used to uniquely identify the AuthenticationResult. This is for example used when a one time password is to be checked on the authentication server.

public string GUID

Field Value

string

IsAdmin

A boolean to indicate that this user is an admin. Is not used formally within Polar Studio but can be used in scripts if wanted.

public bool IsAdmin

Field Value

bool

OneTimePasswordApplicationName

This is the application name as is to be shown in an authenticator

public string OneTimePasswordApplicationName

Field Value

string

OneTimePasswordKey

The key for the OneTimePassword (in case of type 'Local')

public string OneTimePasswordKey

Field Value

string

OneTimePasswordKeyType

The type of OneTimePassword if set.

public AuthenticationResult.OneTimePassword_KeyType OneTimePasswordKeyType

Field Value

AuthenticationResult.OneTimePassword_KeyType

OneTimePasswordStatus

The status of the OneTimePassword. One of: Disabled (0), Enabled (1), Required (2)

public AuthenticationResult.OneTimePassword_Status OneTimePasswordStatus

Field Value

AuthenticationResult.OneTimePassword_Status

OneTimePasswordSuppressAtLogon

This flag can be used to suppress asking the one time password at logon. In that case, it will be only be asked when the user has locked the application. This happens for example when the user has just set a one time password or when the user has 'trusted' the browser.

public bool OneTimePasswordSuppressAtLogon

Field Value

bool

ProviderName

The name of the OAuth provider that validated the email address for this user.

public string ProviderName

Field Value

string

TokenUsed

A boolean indicating a token was used to log on.

public bool TokenUsed

Field Value

bool

UserID

The UserID (UserName). Is often the email address.

public string UserID

Field Value

string

Variables

Custom variables that can be passed in the AuthenticationResult

[JsonIgnore]
public Dictionary Variables

Field Value

Dictionary

WelcomeMessage

A message to show to the user after log on.

public string WelcomeMessage

Field Value

string

Properties

AccessGranted

Boolean that indicates if this user actually has successfully logged on.

[JsonIgnore]
public bool AccessGranted { get; }

Property Value

bool

CustomProperties

CustomProperties can contain name/value pairs (string/string) with application specific properties.

public List<AppConfiguration_CustomProperty> CustomProperties { get; set; }

Property Value

List<AppConfiguration_CustomProperty>

VariablesJSON

An internally used property to communicate the Variables in the JSON.

public string VariablesJSON { get; set; }

Property Value

string

Methods

GetCustomProperty(string, string)

To get the value of a specific custom property.

public string GetCustomProperty(string pName, string pDefaultValue = "")

Parameters

pName string

The name of the custom property

pDefaultValue string

The value to return if the custom property was not found.

Returns

string

The value of the custom property or - if the custom property was not found - the value specified in parameter pDefaultValue

GetJSON()

This method returns the JSON for the AuthenticationResult

public string GetJSON()

Returns

string