AppToken

Field: static readonly AppToken Empty

The default value of any AppToken object. It can be created with default(AppToken).


Method: static AppToken NewAppToken()

AppToken instance can be created with a random Guid value.


Method: static AppToken FromHash(Binary)

The hashed data of the Binary type can be converted to the AppToken.

Parameter Name Description
tokenHash The hashed data of the Binary type

Method: static AppToken Parse(String)

A new AppToken object can be created with token information of string type

If there is schema information in addition at the given value, the data is kept as Scheme and value separately.

    AppToken token = AppToken.Parse("Bearer 6e675cc9fbc24d4a92c6f555a27270e2");
    token.Schema; //Bearer
    token.Value;  //6e675cc9fbc24d4a92c6f555a27270e2
Parameter Name Description
tokenString The token data of the string type

Property: bool IsPlain

Shows the Token Data is kept open in memory.

Returns true if the object was created using the Parse method or the NewAppToken method.


Property: bool IsHash

Shows the Token Data is kept hashed in memory.

Returns true if the object was created using the FromHash method.


Property: bool IsEmpty

Shows the Token data is empty.

Returns true if IsPlain and IsHashed are false


Property: string Value

Directly calls the ToString method.


Property: string Scheme

If the schema information is sent along with the token to the Parse method, the schema information is kept here. Example: Basic, Bearer

If the schema information is not specified, the default schema is Bearer

Tokens created via FromHash method do not have schema information.


Method: string ToString()

Returns token information in string type

Returns decrypted token, If IsPlain is true.

Returns hashed token, If IsHashed is true.

Returns token information created with empty Guid, If IsEmpty is true.


Method: object Clone()

It creates and returns a new instance with the string or hashed data.


Method: bool Equals(Object)

Returns true if the given object is an AppToken object and has the same hash, false otherwise.

Parameter Name Description
obj Compared object

Method: bool Equals(AppToken)

Returns true if the given object has the same hash, false otherwise.

Parameter Name Description
other Comaped object