public GetApiKeyWithPrefix ( string apiKeyIdentifier ) : string | ||
apiKeyIdentifier | string | API key identifier (authentication scheme). |
return | string |
public string GetApiKeyWithPrefix(string apiKeyIdentifier)
{
var apiKeyValue = "";
ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue);
var apiKeyPrefix = "";
if (ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix))
return apiKeyPrefix + " " + apiKeyValue;
else
return apiKeyValue;
}
public void TestAuthentication() { Configuration c = new Configuration (); c.Username = "******"; c.Password = "******"; c.ApiKey ["api_key_identifier"] = "1233456778889900"; c.ApiKeyPrefix ["api_key_identifier"] = "PREFIX"; Assert.AreEqual (c.GetApiKeyWithPrefix("api_key_identifier"), "PREFIX 1233456778889900"); }