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
stringThe UserID used to log in. Does not necessarily have to match the used UserID, but can also be something like 'Guest'
pFullName
stringThe full name of the user
pApplicationPID
stringThe PID of the application this user gets access to in the application. Can also be '*' to give access to the first application.
pGroupPID
stringThe PID of the group
pPrivateRecordID
stringAn ID of the Private Record (when the UserGroup is linked to a table in the database)
pApplicationAccessGUID
stringThe 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
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
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
DefaultLanguageID
The ID of the default language to use.
public int DefaultLanguageID
Field Value
FullName
The full name of the user, like John Doe
public string FullName
Field Value
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
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
OneTimePasswordApplicationName
This is the application name as is to be shown in an authenticator
public string OneTimePasswordApplicationName
Field Value
OneTimePasswordKey
The key for the OneTimePassword (in case of type 'Local')
public string OneTimePasswordKey
Field Value
OneTimePasswordKeyType
The type of OneTimePassword if set.
public AuthenticationResult.OneTimePassword_KeyType OneTimePasswordKeyType
Field Value
OneTimePasswordStatus
The status of the OneTimePassword. One of: Disabled (0), Enabled (1), Required (2)
public AuthenticationResult.OneTimePassword_Status OneTimePasswordStatus
Field Value
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
ProviderName
The name of the OAuth provider that validated the email address for this user.
public string ProviderName
Field Value
TokenUsed
A boolean indicating a token was used to log on.
public bool TokenUsed
Field Value
UserID
The UserID (UserName). Is often the email address.
public string UserID
Field Value
Variables
Custom variables that can be passed in the AuthenticationResult
[JsonIgnore]
public Dictionary Variables
Field Value
WelcomeMessage
A message to show to the user after log on.
public string WelcomeMessage
Field Value
Properties
AccessGranted
Boolean that indicates if this user actually has successfully logged on.
[JsonIgnore]
public bool AccessGranted { get; }
Property Value
CustomProperties
CustomProperties can contain name/value pairs (string/string) with application specific properties.
public List<AppConfiguration_CustomProperty> CustomProperties { get; set; }
Property Value
VariablesJSON
An internally used property to communicate the Variables in the JSON.
public string VariablesJSON { get; set; }
Property Value
Methods
GetCustomProperty(string, string)
To get the value of a specific custom property.
public string GetCustomProperty(string pName, string pDefaultValue = "")
Parameters
pName
stringThe name of the custom property
pDefaultValue
stringThe 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()