C# Class MobileAppAPIHelper, Rockit

ファイルを表示 Open project: NewPointe/Rockit

Public Methods

Method Description
APIKey ( ) : string

This will pull the api key generated in rock. The name of it needs to be AppRestKey. It can be changed whenever from the website, this function will pull it based on the name in case the key becomes compromised if it can't find it, it will return empty string and the request will return unauthorized

ValidateAppToken ( HttpRequestMessage request ) : bool

Private Methods

Method Description
ValidateToken ( string token ) : bool

this just verifies (loosely) that the request came from the app. By matching the key stored in the app's code.

Method Details

APIKey() public static method

This will pull the api key generated in rock. The name of it needs to be AppRestKey. It can be changed whenever from the website, this function will pull it based on the name in case the key becomes compromised if it can't find it, it will return empty string and the request will return unauthorized
public static APIKey ( ) : string
return string

ValidateAppToken() public static method

public static ValidateAppToken ( HttpRequestMessage request ) : bool
request System.Net.Http.HttpRequestMessage
return bool