Click or drag to resize

UserContext Class

After authentication, the UserContext object holds the current user identity and a collection of profiles.
Inheritance Hierarchy
SystemObject
  NetQuarry.SecurityUserContext

Namespace:  NetQuarry.Security
Assembly:  EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
[SerializableAttribute]
public class UserContext

The UserContext type exposes the following members.

Constructors
  NameDescription
Public methodUserContext
Creates a UserContext object.
Top
Properties
  NameDescription
Public propertyAnswer
Returns the PasswordAnswer
Public propertyAttributes
A bitmask of UserAttrs values.
Public propertyAuthenticationProviderType
Gets/Sets the type of the authentication provider
Public propertyDeviceID
Gets/Sets the user's device ID
Public propertyDeviceToken
Gets/Sets the device token. The device token is permanent and can be used to login as the user in a web service.
Public propertyEmailAddress
Returns the EmailAddress
Public propertyEncryptedPassword
Returns the password encrypted
Public propertyHasMinimalAccess
Gets whether or not the user has minimal access. Currently this is only the case when the ForcePasswordChange attribute is set.
Public propertyID
Returns the User ID
Public propertyInCompliance
Identifies whether or not the user is in compliance with all current user agreements and other introductory material. Note that InCompliance does not determine if compliance has been met, it is just used to expose the compliance state as determined during login and similar activities. Use DetermineCompliance to actively interrogate the database as to compliance state (that method will update InCompliance).
Public propertyIsValid
Returns true if the object is valid.
Public propertyName
Returns the User name
Public propertyPackageLevelID
Gets/Sets the package_level_id from the users view/table
Public propertyPassword
Returns the Password
Public propertyProfiles
Returns the list of user profiles
Public propertyProxyUserID
Gets/Sets the Proxy ID for this object. This is used when logging on behalf of another user.
Public propertyQuestion
Returns the Password Question
Public propertySignature
Sets the signature for this user. This property should be set during startup.
Public propertyStartPage
Returns the start page
Public propertyToken
Returns the user token
Public propertyUserGUID
Gets/Sets the UserGUID for this object.
Top
Methods
  NameDescription
Public methodStatic memberBuildProfileRolesCollection
Returns a NameValueCollection of the profile/roles map including all potential roles in the database. This collection can be used to provide the set of valid roles to Authenticate(String, String, NameValueCollection, Int64) when validating a user.
Public methodChangePassword
Change the current password
Public methodClearTokens
Clears ALL user tokens for this user.
Public methodClone
Returns a copy of this object.
Public methodDetermineCompliance
Determines if the current user is in compliance with all current user agreements and other introductory material (InCompliance). If the user is not currently marked as InCompliance then the database will be interrogated to determine whether the user is actually in compliance and update the InCompliance value accordingly. This method is primarily intended for use during login and similar activities and otherwise you should generally use InCompliance.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberGetDirectLoginURL
Returns a direct login URL BugzID: 92963 - Platform way to get a one-time login url for a user id
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodStatic memberGetProviderType
Returns the type of the provider to use for this application
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasPermission
Returns true if the specified object "has" the permission. If the object has no assigned permisions, the return value is true.
Public methodHasProfile
Checks the list of profiles for a specific match.
Public methodStatic memberLoad
Loads the UserContext object by looking up the token in the database
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPermissions
Returns a bitmask of the object's permissions. If the object has no assigned permissions, the return value is 0xffffffff (All permission bits are set)
Public methodPersist(IAppContext)
Creates a token and caches it to the local (meta) database
Public methodPersist(IAppContext, String)
Caches the current credentials to the database using the specified token.
Public methodPersistDeviceToken
Creates or looks up the device token for the current user, device, and os
Public methodRefreshPermissions(IAppContext)
Reloads the permissions for this UserContext.
Public methodRefreshPermissions(String, String)
Refresh permissions for a specific object. The specified ID should be the ID of the object itself, or of its parent object, depending on the type of object. For example, when refreshing permissions for "page_element" the ID should be the ID of the parent PageInfo. Note that this method is primarily intended for internal platform use.
Public methodRemoveDeviceToken
If non admin user: removes the current device token OR removes all device tokens of the current user so that they are no longer valid. If admin user: can remove device token(s) of a different user if the other user's info is specified in the arguments. Otherwise works like non admin user.
Public methodRemoveToken
Removes the user token from the database
Public methodResetPassword
Sets the password to null, sets the ForcePasswordChange attribute on the user and (optionally) sends the user a way to reset it via email.
Public methodStatic memberRestore
Restores the UserContext object by looking up the data from the users table
Public methodSendPassword
Sends the user id and password in clear text in an email message to the user.
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodUpdateToken
Updates the token record to the current time.
Top
Extension Methods
  NameDescription
Public Extension MethodEqualValue
Determines if the object value is equal to another object. If the two objects are null, then this returns true. There is special handling for guid comparisons (since a guid could be a string formatted in up to 3 different ways). If the special guid handling is not performed, then the object.Equals method is used.
(Defined by EAPUtil.)
Top
Remarks
A UserContext object can re-create itself from a token securely. The IAppContext object holds the current UserContext.
See Also