2013-06-14 17:44:55 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
2013-06-14 13:11:42 +01:00
|
|
|
|
using IF.Lastfm.Core.Api.Helpers;
|
2013-06-11 17:40:22 +01:00
|
|
|
|
using IF.Lastfm.Core.Objects;
|
2013-06-08 18:49:21 +01:00
|
|
|
|
|
|
|
|
|
namespace IF.Lastfm.Core.Api
|
|
|
|
|
{
|
|
|
|
|
public interface IAuth
|
|
|
|
|
{
|
2013-06-11 17:40:22 +01:00
|
|
|
|
bool HasAuthenticated { get; }
|
2013-06-08 18:49:21 +01:00
|
|
|
|
string ApiKey { get; }
|
2013-06-11 17:40:22 +01:00
|
|
|
|
UserSession User { get; }
|
2013-06-08 18:49:21 +01:00
|
|
|
|
|
2013-06-23 23:58:42 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Load an existing user session object.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="session"></param>
|
|
|
|
|
/// <returns>Whether session object is valid</returns>
|
|
|
|
|
bool LoadSession(UserSession session);
|
|
|
|
|
|
2013-06-08 18:49:21 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the session token which is used as authentication for any service calls.
|
|
|
|
|
/// Username and password aren't stored.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="username">Username</param>
|
|
|
|
|
/// <param name="password">User's password</param>
|
|
|
|
|
/// <returns>Session token used to authenticate calls to last.fm</returns>
|
2013-06-11 17:40:22 +01:00
|
|
|
|
/// <remarks>API: Auth.getMobileSession</remarks>
|
2013-06-14 13:11:42 +01:00
|
|
|
|
Task<LastResponse> GetSessionTokenAsync(string username, string password);
|
2013-06-14 17:44:55 +01:00
|
|
|
|
|
|
|
|
|
string GenerateMethodSignature(string method, Dictionary<string, string> parameters = null);
|
2013-06-08 18:49:21 +01:00
|
|
|
|
}
|
|
|
|
|
}
|