/// <summary> /// Initialized a new instance of AuthOptions by populating the KeyId and KeyValue properties from the full Key /// </summary> /// <param name="key">Full ably key string</param> public AuthOptions(string key) : this() { var apiKey = ApiKey.Parse(key); Key = apiKey.ToString(); }
/// <summary> /// Initialized a new instance of AuthOptions by populating the KeyId and KeyValue properties from the full Key. /// </summary> /// <param name="key">Full ably key string.</param> public AuthOptions(string key) : this() { if (key.IsEmpty()) { throw new AblyException(new ErrorInfo("Auth Key cannot be empty", ErrorCodes.UnableToObtainCredentialsFromGivenParameters)); } if (key.Contains(":")) { var apiKey = ApiKey.Parse(key); Key = apiKey.ToString(); } else { Token = key; } }
internal ApiKey ParseKey() { return(ApiKey.Parse(Key)); }