TypeKeySecurity

TypeKeySecurity library documentation

TypeKeySecurity Namespace

The TypeKeySecurity namespace contains classes that are used to implement TypeKey security in Web server applications.

Classes

Class | Description
TypeKeyAuthenticationModule | Module that takes care of checking incoming requests for TypeKey identity assertions, and create a TypeKeyIdentity object accordingly.
TypeKeyIdentity | Represents the Identity of a User.
TypeKeyNameHash | Numeric representation (128 bits) of the unique identifier (TypeKey name) of a user. Derived from the name using a MD5 hash.


TypeKeyAuthenticationModule Class

Module that takes care of checking incoming requests for TypeKey identity assertions, and create a TypeKeyIdentity object accordingly.

For a list of all members of this type, see TypeKeyAuthenticationModule Members.

System.Object
TypeKeyAuthenticationModule

public sealed class TypeKeyAuthenticationModule : IHttpModule

Remarks

The TypeKey protocol is documented at http://www.movabletype.org/docs/tk-apps.html. This module enables you to use the TypeKey service with minimal code. For your ASP.Net site to use this module, it needs to be listed in the httpModules in your web.config, as shown below.

            <?xml version="1.0" encoding="utf-8" ?>
            <configuration>
                <system.web>
                    <authentication mode="None" />
                    <httpModules>
                        <add name="TypeKeyAuthenticationModule"
                        type="TypeKeySecurity.TypeKeyAuthenticationModule, TypeKeySecurity" />
                    </httpModules>
                </system.web>
                <appSettings>
                    <add key="TypeKeySecurity.Token.Value" value="0123456789ABCDEF0123" />
                </appSettings>
            </configuration>

Requirements

Namespace: TypeKeySecurity

Assembly: TypeKeySecurity (in TypeKeySecurity.dll)

See Also

TypeKeyAuthenticationModule Members | TypeKeySecurity Namespace


TypeKeyAuthenticationModule Members

TypeKeyAuthenticationModule overview

Public Instance Constructors

TypeKeyAuthenticationModule Constructor Initializes a new instance of the TypeKeyAuthenticationModule class.

Public Instance Methods

Dispose | Disposes the module.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Init | Initializes the module derived from IHttpModule when called by the HttpRuntime.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TypeKeyAuthenticationModule Class | TypeKeySecurity Namespace


TypeKeyAuthenticationModule Constructor

Initializes a new instance of the TypeKeyAuthenticationModule class.

public TypeKeyAuthenticationModule();

See Also

TypeKeyAuthenticationModule Class | TypeKeySecurity Namespace


TypeKeyAuthenticationModule Methods

The methods of the TypeKeyAuthenticationModule class are listed below. For a complete list of TypeKeyAuthenticationModule class members, see the TypeKeyAuthenticationModule Members topic.

Public Instance Methods

Dispose | Disposes the module.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Init | Initializes the module derived from IHttpModule when called by the HttpRuntime.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TypeKeyAuthenticationModule Class | TypeKeySecurity Namespace


TypeKeyAuthenticationModule.Dispose Method

Disposes the module.

public void Dispose();

Implements

IHttpModule.Dispose

See Also

TypeKeyAuthenticationModule Class | TypeKeySecurity Namespace


TypeKeyAuthenticationModule.Init Method

Initializes the module derived from IHttpModule when called by the HttpRuntime.

public void Init(
HttpApplication httpapp
);

Parameters

httpapp
Missing <param> documentation for httpapp

Implements

IHttpModule.Init

See Also

TypeKeyAuthenticationModule Class | TypeKeySecurity Namespace


TypeKeyIdentity Class

Represents the Identity of a User.

For a list of all members of this type, see TypeKeyIdentity Members.

System.Object
TypeKeyIdentity

public class TypeKeyIdentity : IIdentity

Remarks

After you install the TypeKeyAuthenticationModule, a TypeKeyIdentity object is made available to you in every incoming request.
For more information on TypeKey authentication, see http://www.movabletype.org/docs/tk-apps.html.

Example

            using TypeKeySecurity;

            TypeKeyIdentity id = (TypeKeyIdentity)Context.User.Identity;

            // was the user authenticated within 600 seconds (10 minutes)?
            if (id.IsAuthFresh(600)) {
                // access id.Name, id.NameHash, id.Email and id.Nick
                // log the user out with LogoutUser and LogoutUrl
            } else {
                id.LoginUser(false); // force the user to log in
                // or use LoginUrl
            }

Requirements

Namespace: TypeKeySecurity

Assembly: TypeKeySecurity (in TypeKeySecurity.dll)

See Also

TypeKeyIdentity Members | TypeKeySecurity Namespace


TypeKeyIdentity Members

TypeKeyIdentity overview

Public Static Fields

COOKIE_EXPIRATION_DEFAULT | Default expiration time for the authentication cookie.
COOKIE_EXPIRATION_KEY | The cookie expiration may be configured in the web.config file using this key.
COOKIE_NAME_DEFAULT | Default name for the authentication cookie.
COOKIE_NAME_KEY | The cookie name may be configured in the web.config file using this key.
FOAF_LOCATION_DEFAULT | Default url for the TypeKey FOAF files.
FOAF_LOCATION_KEY |
LOGIN_LOCATION_DEFAULT | Default url for the TypeKey login service.
LOGIN_LOCATION_KEY | The url of the TypeKey login service can be configured via the AppSettings in the web.config file using this key.
LOGOUT_LOCATION_DEFAULT | Default url for the TypeKey logout service.
LOGOUT_LOCATION_KEY | The url for the TypeKey logout service can be configured via the AppSettings in the web.config file using this key.
PUBKEY_LOCATION_DEFAULT | Default url for the TypeKey public DSA key.
PUBKEY_LOCATION_KEY | The location for fetching the public DSA key for the TypeKey service can be configured via the AppSettings in the web.config file using this key.
SITE_TOKEN_KEY | The site token has to be configured via the AppSettings in the web.config file using this key.

Public Static Methods

MakeLogoutCookie Clear the authentication cookie.

Public Instance Properties

AuthenticationType | Gets the type of authentication used to identify the user.
Email | Email address of the authenticated user.
FOAFUrl | Url for the FOAF file for the authenticated user.
IsAuthenticated | Whether the user was authenticated. Caller should also use IsAuthFresh to verify freshness of the authentication.
Name | Login name of an authenticated user. Unique identifier.
NameHash | MD5 hash of Name. Provides a numerical unique identifier (an 128 bit integer).
Nick | Display name of the authenticated user.
TimeStamp | Timestamp of the authentication.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetCleanUrl | Overloaded. Get the current url, cleaned of any TypeKey specific parameters.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IsAuthFresh | Whether the authentication occured within the timewindow.
IsEmailHashed | Whether the Email field is a SHA-1 hash or an actual email address.
LoginUrl | Overloaded. Build a url to send the user to the Typekey server to get authenticated, with the return url set to the current page.
LoginUser | Overloaded. Redirect the user to the Typekey server to get authenticated, with the return url set to the current page.
LogoutUrl | Overloaded. Build a url to send the user to the TypeKey server to get logged out
LogoutUser | Overloaded. Clear authentication cookies and redirect to TypeKey logout url.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace


TypeKeyIdentity Fields

The fields of the TypeKeyIdentity class are listed below. For a complete list of TypeKeyIdentity class members, see the TypeKeyIdentity Members topic.

Public Static Fields

COOKIE_EXPIRATION_DEFAULT | Default expiration time for the authentication cookie.
COOKIE_EXPIRATION_KEY | The cookie expiration may be configured in the web.config file using this key.
COOKIE_NAME_DEFAULT | Default name for the authentication cookie.
COOKIE_NAME_KEY | The cookie name may be configured in the web.config file using this key.
FOAF_LOCATION_DEFAULT | Default url for the TypeKey FOAF files.
FOAF_LOCATION_KEY |
LOGIN_LOCATION_DEFAULT | Default url for the TypeKey login service.
LOGIN_LOCATION_KEY | The url of the TypeKey login service can be configured via the AppSettings in the web.config file using this key.
LOGOUT_LOCATION_DEFAULT | Default url for the TypeKey logout service.
LOGOUT_LOCATION_KEY | The url for the TypeKey logout service can be configured via the AppSettings in the web.config file using this key.
PUBKEY_LOCATION_DEFAULT | Default url for the TypeKey public DSA key.
PUBKEY_LOCATION_KEY | The location for fetching the public DSA key for the TypeKey service can be configured via the AppSettings in the web.config file using this key.
SITE_TOKEN_KEY | The site token has to be configured via the AppSettings in the web.config file using this key.

See Also


TypeKeyIdentity.COOKIE_EXPIRATION_DEFAULT Field

Default expiration time for the authentication cookie.

public const int COOKIE_EXPIRATION_DEFAULT;

Remarks

Expiration time in seconds. Zero is used to signify a "session" cookie. Default is "0".

See Also


TypeKeyIdentity.COOKIE_EXPIRATION_KEY Field

The cookie expiration may be configured in the web.config file using this key.

public const string COOKIE_EXPIRATION_KEY;

Remarks

Zero means session cookie.

See Also


TypeKeyIdentity.COOKIE_NAME_DEFAULT Field

Default name for the authentication cookie.

public const string COOKIE_NAME_DEFAULT;

Remarks

Default url is "tkcookie"

See Also


TypeKeyIdentity.COOKIE_NAME_KEY Field

The cookie name may be configured in the web.config file using this key.

public const string COOKIE_NAME_KEY;

Remarks

Chances are the default cookie name is fine for most uses.

See Also


TypeKeyIdentity.FOAF_LOCATION_DEFAULT Field

Default url for the TypeKey FOAF files.

public const string FOAF_LOCATION_DEFAULT;

Remarks

Default url is "http://profile.typekey.com/{0}/foaf.rdf". {0} replaces the user name.

See Also


TypeKeyIdentity.FOAF_LOCATION_KEY Field

public const string FOAF_LOCATION_KEY;

Remarks

See Also


TypeKeyIdentity.LOGIN_LOCATION_DEFAULT Field

Default url for the TypeKey login service.

public const string LOGIN_LOCATION_DEFAULT;

Remarks

Default url is "https://www.typekey.com/t/typekey/login"

See Also


TypeKeyIdentity.LOGIN_LOCATION_KEY Field

The url of the TypeKey login service can be configured via the AppSettings in the web.config file using this key.

public const string LOGIN_LOCATION_KEY;

Remarks

If you don't use the TypeKey hosted authentication, use the web.config to specify the login url.

See Also


TypeKeyIdentity.LOGOUT_LOCATION_DEFAULT Field

Default url for the TypeKey logout service.

public const string LOGOUT_LOCATION_DEFAULT;

Remarks

Default url is "https://www.typekey.com/t/typekey/logout"

See Also


TypeKeyIdentity.LOGOUT_LOCATION_KEY Field

The url for the TypeKey logout service can be configured via the AppSettings in the web.config file using this key.

public const string LOGOUT_LOCATION_KEY;

Remarks

If you don't use the TypeKey hosted authentication, use the web.config to specify the logout url.

See Also


TypeKeyIdentity.PUBKEY_LOCATION_DEFAULT Field

Default url for the TypeKey public DSA key.

public const string PUBKEY_LOCATION_DEFAULT;

Remarks

Default url is "http://www.typekey.com/extras/regkeys.txt".

See Also


TypeKeyIdentity.PUBKEY_LOCATION_KEY Field

The location for fetching the public DSA key for the TypeKey service can be configured via the AppSettings in the web.config file using this key.

public const string PUBKEY_LOCATION_KEY;

Remarks

If you don't use the TypeKey hosted authentication, use the web.config to specify the public key url.

See Also


TypeKeyIdentity.SITE_TOKEN_KEY Field

The site token has to be configured via the AppSettings in the web.config file using this key.

public const string SITE_TOKEN_KEY;

Remarks

This token is provided when you register your site with the TypeKey service. You can't use TypeKey if you don't configure this

Example

            <appSettings>
                <add key="TypeKeySecurity.Token.Value" value="0123456789ABCDEF0123" />
            </appSettings>

See Also


TypeKeyIdentity Properties

The properties of the TypeKeyIdentity class are listed below. For a complete list of TypeKeyIdentity class members, see the TypeKeyIdentity Members topic.

Public Instance Properties

AuthenticationType | Gets the type of authentication used to identify the user.
Email | Email address of the authenticated user.
FOAFUrl | Url for the FOAF file for the authenticated user.
IsAuthenticated | Whether the user was authenticated. Caller should also use IsAuthFresh to verify freshness of the authentication.
Name | Login name of an authenticated user. Unique identifier.
NameHash | MD5 hash of Name. Provides a numerical unique identifier (an 128 bit integer).
Nick | Display name of the authenticated user.
TimeStamp | Timestamp of the authentication.

See Also


TypeKeyIdentity.AuthenticationType Property

Gets the type of authentication used to identify the user.

public string AuthenticationType {get;}

Property Value

Returns the string "Custom".

Implements

IIdentity.AuthenticationType

See Also


TypeKeyIdentity.Email Property

Email address of the authenticated user.

public string Email {get;}

Property Value

Returns an empty string if the user isn't authenticated.

Remarks

Only the SHA-1 hash of the email is available by default, unless needEmail was set to true during the authentication request.

See Also


TypeKeyIdentity.FOAFUrl Property

Url for the FOAF file for the authenticated user.

public string FOAFUrl {get;}

Property Value

FOAF file's location.

Remarks

Returns an empty string if the user isn't authenticated.

See Also


TypeKeyIdentity.IsAuthenticated Property

Whether the user was authenticated. Caller should also use IsAuthFresh to verify freshness of the authentication.

public bool IsAuthenticated {get;}

Property Value

If the user has creds, returns true.

Implements

IIdentity.IsAuthenticated

Remarks

This method doesn't consider whether the creds are fresh or not.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | IsAuthFresh


TypeKeyIdentity.Name Property

Login name of an authenticated user. Unique identifier.

public string Name {get;}

Property Value

String representing the user's login name.

Implements

IIdentity.Name

Remarks

Returns an empty string if the user isn't authenticated.

See Also


TypeKeyIdentity.NameHash Property

MD5 hash of Name. Provides a numerical unique identifier (an 128 bit integer).

public TypeKeyNameHash NameHash {get;}

Property Value

A TypeKeyNameHash object derived from the Name.

Remarks

Returns hash zero if the user isn't authenticated.

See Also


TypeKeyIdentity.Nick Property

Display name of the authenticated user.

public string Nick {get;}

Property Value

The display name of the user.

Remarks

Returns an empty string if the user isn't authenticated.

See Also


TypeKeyIdentity.TimeStamp Property

Timestamp of the authentication.

public int TimeStamp {get;}

Property Value

Time of the authentication in epoch.

Remarks

Returns zero if the user isn't authenticated.

See Also


TypeKeyIdentity Methods

The methods of the TypeKeyIdentity class are listed below. For a complete list of TypeKeyIdentity class members, see the TypeKeyIdentity Members topic.

Public Static Methods

MakeLogoutCookie Clear the authentication cookie.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetCleanUrl | Overloaded. Get the current url, cleaned of any TypeKey specific parameters.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IsAuthFresh | Whether the authentication occured within the timewindow.
IsEmailHashed | Whether the Email field is a SHA-1 hash or an actual email address.
LoginUrl | Overloaded. Build a url to send the user to the Typekey server to get authenticated, with the return url set to the current page.
LoginUser | Overloaded. Redirect the user to the Typekey server to get authenticated, with the return url set to the current page.
LogoutUrl | Overloaded. Build a url to send the user to the TypeKey server to get logged out
LogoutUser | Overloaded. Clear authentication cookies and redirect to TypeKey logout url.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also


GetCleanUrl Method

TypeKeySecurity library documentation

TypeKeyIdentity.GetCleanUrl Method

Get the current url, cleaned of any TypeKey specific parameters.

Overload List

Get the current url, cleaned of any TypeKey specific parameters.

public string GetCleanUrl();

Clean a dirty url of any TypeKey specific parameters.

public string GetCleanUrl(Uri);

See Also


TypeKeyIdentity.GetCleanUrl Method ()

Get the current url, cleaned of any TypeKey specific parameters.

public string GetCleanUrl();

Return Value

The cleaned current url, as a string.

Remarks

The querystring parameters that TypeKey uses are ts, name, nick, email and sig.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | TypeKeyIdentity.GetCleanUrl Overload List


TypeKeyIdentity.GetCleanUrl Method (Uri)

Clean a dirty url of any TypeKey specific parameters.

public string GetCleanUrl(
Uri dirtyUrl
);

Parameters

dirtyUrl
The Uri that needs cleaning.

Return Value

The cleaned url, as a string.

Remarks

The querystring parameters that TypeKey uses are ts, name, nick, email and sig.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | TypeKeyIdentity.GetCleanUrl Overload List


TypeKeyIdentity.IsAuthFresh Method

Whether the authentication occured within the timewindow.

public bool IsAuthFresh(
int timewindow
);

Parameters

timewindow
Time window in seconds.

Return Value

Returns true if the user was authenticated less than timewindow seconds ago.

Remarks

The timewindow is sensitive to any time skews between your server and the TypeKey server.

See Also


TypeKeyIdentity.IsEmailHashed Method

Whether the Email field is a SHA-1 hash or an actual email address.

public bool IsEmailHashed();

Return Value

Returns true if it's a SHA-1 hash.

Remarks

If the authentication occured with needEmail set to true, then the actual email should be available.

See Also


LoginUrl Method

TypeKeySecurity library documentation

TypeKeyIdentity.LoginUrl Method

Build a url to send the user to the Typekey server to get authenticated, with the return url set to the current page.

Overload List

Build a url to send the user to the Typekey server to get authenticated, with the return url set to the current page.

public string LoginUrl(bool);

Build a url to send the user to the Typekey server to get authenticated.

public string LoginUrl(bool,string);

See Also


TypeKeyIdentity.LoginUrl Method (Boolean)

Build a url to send the user to the Typekey server to get authenticated, with the return url set to the current page.

public string LoginUrl(
bool needEmail
);

Parameters

needEmail
Whether you are requesting the cleartext version of the user's email.

Return Value

Returns a TypeKey url that will prompt the user for his creds or silently log him in, when possible.

Remarks

Unless you really need the user's email, use needEmail=false.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | TypeKeyIdentity.LoginUrl Overload List


TypeKeyIdentity.LoginUrl Method (Boolean, String)

Build a url to send the user to the Typekey server to get authenticated.

public string LoginUrl(
bool needEmail,
string returnUrl
);

Parameters

needEmail
Whether you are requesting the cleartext version of the user's email.
returnUrl
Specify the return url you need.

Return Value

Returns a TypeKey url that will prompt the user for his creds or silently log him in (when possible).

Remarks

The user will be sent back the the returnUrl you specify. Unless you really need the user's email, use needEmail=false.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | TypeKeyIdentity.LoginUrl Overload List


LoginUser Method

TypeKeySecurity library documentation

TypeKeyIdentity.LoginUser Method

Redirect the user to the Typekey server to get authenticated, with the return url set to the current page.

Overload List

Redirect the user to the Typekey server to get authenticated, with the return url set to the current page.

public void LoginUser(bool);

Redirect the user to the Typekey server to get authenticated.

public void LoginUser(bool,string);

See Also


TypeKeyIdentity.LoginUser Method (Boolean)

Redirect the user to the Typekey server to get authenticated, with the return url set to the current page.

public void LoginUser(
bool needEmail
);

Parameters

needEmail
Whether you are requesting the cleartext version of the user's email.

Remarks

Use this for pages that require the user to be logged in.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | TypeKeyIdentity.LoginUser Overload List


TypeKeyIdentity.LoginUser Method (Boolean, String)

Redirect the user to the Typekey server to get authenticated.

public void LoginUser(
bool needEmail,
string returnUrl
);

Parameters

needEmail
Whether you are requesting the cleartext version of the user's email.
returnUrl
Specify the return url you need.

Remarks

Use this for pages that require the user to be logged in.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | TypeKeyIdentity.LoginUser Overload List


LogoutUrl Method

TypeKeySecurity library documentation

TypeKeyIdentity.LogoutUrl Method

Build a url to send the user to the TypeKey server to get logged out

Overload List

Build a url to send the user to the TypeKey server to get logged out

public string LogoutUrl();

Build a url to send the user to the TypeKey server to get logged out.

public string LogoutUrl(string);

See Also


TypeKeyIdentity.LogoutUrl Method ()

Build a url to send the user to the TypeKey server to get logged out

public string LogoutUrl();

Return Value

Returns the TypeKey logout url with a return url to the current page.

Remarks

After the user is logged out, he'll be sent back the current page.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | TypeKeyIdentity.LogoutUrl Overload List


TypeKeyIdentity.LogoutUrl Method (String)

Build a url to send the user to the TypeKey server to get logged out.

public string LogoutUrl(
string returnUrl
);

Parameters

returnUrl
Specify the return url you need.

Return Value

Returns the TypeKey logout url with a return url to the returnUrl.

Remarks

After the user is logged out, he'll be sent back the returnUrl.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | TypeKeyIdentity.LogoutUrl Overload List


LogoutUser Method

TypeKeySecurity library documentation

TypeKeyIdentity.LogoutUser Method

Clear authentication cookies and redirect to TypeKey logout url.

Overload List

Clear authentication cookies and redirect to TypeKey logout url.

public void LogoutUser();

Clear authentication cookies and redirect to TypeKey logout url.

public void LogoutUser(string);

See Also


TypeKeyIdentity.LogoutUser Method ()

Clear authentication cookies and redirect to TypeKey logout url.

public void LogoutUser();

Remarks

Returns back to the current url (with logout=1).

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | TypeKeyIdentity.LogoutUser Overload List


TypeKeyIdentity.LogoutUser Method (String)

Clear authentication cookies and redirect to TypeKey logout url.

public void LogoutUser(
string returnUrl
);

Parameters

returnUrl
Where the user should be returned after getting logged out.

Remarks

Returns back to the returnUrl with logout=1.

See Also

TypeKeyIdentity Class | TypeKeySecurity Namespace | TypeKeyIdentity.LogoutUser Overload List


TypeKeyIdentity.MakeLogoutCookie Method

Clear the authentication cookie.

public static HttpCookie MakeLogoutCookie();

Return Value

A cookie that expires the authentication cookie and blanks it out.

Remarks

Only useful if you want to write your own sign-out code.

See Also


TypeKeyNameHash Class

Numeric representation (128 bits) of the unique identifier (TypeKey name) of a user. Derived from the name using a MD5 hash.

For a list of all members of this type, see TypeKeyNameHash Members.

System.Object
TypeKeyNameHash

public class TypeKeyNameHash

Remarks

Returned by TypeKeyIdentity.NameHash. TypeKeyIdentity.Name is the original unique identifier, in a string format.

Requirements

Namespace: TypeKeySecurity

Assembly: TypeKeySecurity (in TypeKeySecurity.dll)

See Also

TypeKeyNameHash Members | TypeKeySecurity Namespace


TypeKeyNameHash Members

TypeKeyNameHash overview

Public Instance Properties

IdHigh | Gets the high 64 bits of the name hash.
IdLow | Gets the low 64 bits of the name hash.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Convert the 128 number to a hexadecimal string.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TypeKeyNameHash Class | TypeKeySecurity Namespace


TypeKeyNameHash Properties

The properties of the TypeKeyNameHash class are listed below. For a complete list of TypeKeyNameHash class members, see the TypeKeyNameHash Members topic.

Public Instance Properties

IdHigh | Gets the high 64 bits of the name hash.
IdLow | Gets the low 64 bits of the name hash.

See Also

TypeKeyNameHash Class | TypeKeySecurity Namespace


TypeKeyNameHash.IdHigh Property

Gets the high 64 bits of the name hash.

public long IdHigh {get;}

Property Value

The top half of the hash, as an Int64.

See Also

TypeKeyNameHash Class | TypeKeySecurity Namespace


TypeKeyNameHash.IdLow Property

Gets the low 64 bits of the name hash.

public long IdLow {get;}

Property Value

The bottom half of the hash, as an Int64.

See Also

TypeKeyNameHash Class | TypeKeySecurity Namespace


TypeKeyNameHash Methods

The methods of the TypeKeyNameHash class are listed below. For a complete list of TypeKeyNameHash class members, see the TypeKeyNameHash Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Convert the 128 number to a hexadecimal string.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TypeKeyNameHash Class | TypeKeySecurity Namespace


TypeKeyNameHash.ToString Method

Convert the 128 number to a hexadecimal string.

public override string ToString();

Return Value

Returns a string formatted as "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF".

See Also

TypeKeyNameHash Class | TypeKeySecurity Namespace