Add upnp configuration

This commit is contained in:
Luke Pulverenti
2014-02-25 23:38:21 -05:00
parent 7767580a3b
commit 13563b6047
21 changed files with 383 additions and 158 deletions

View File

@@ -189,7 +189,7 @@ namespace MediaBrowser.Api
{
throw new ArgumentNullException("xmlSerializer");
}
_xmlSerializer = xmlSerializer;
_userManager = userManager;
_dtoService = dtoService;
@@ -306,6 +306,26 @@ namespace MediaBrowser.Api
var auth = AuthorizationRequestFilterAttribute.GetAuthorization(Request);
// Login in the old way if the header is missing
if (string.IsNullOrEmpty(auth.Client) ||
string.IsNullOrEmpty(auth.Device) ||
string.IsNullOrEmpty(auth.DeviceId) ||
string.IsNullOrEmpty(auth.Version))
{
var success = await _userManager.AuthenticateUser(user, request.Password).ConfigureAwait(false);
if (!success)
{
// Unauthorized
throw new UnauthorizedAccessException("Invalid user or password entered.");
}
return new AuthenticationResult
{
User = _dtoService.GetUserDto(user)
};
}
var session = await _sessionMananger.AuthenticateNewSession(user, request.Password, auth.Client, auth.Version,
auth.DeviceId, auth.Device, Request.RemoteIp).ConfigureAwait(false);