diff --git a/src/Umbraco.Core/Security/AuthenticationExtensions.cs b/src/Umbraco.Core/Security/AuthenticationExtensions.cs index 45c290daba..a460f32e55 100644 --- a/src/Umbraco.Core/Security/AuthenticationExtensions.cs +++ b/src/Umbraco.Core/Security/AuthenticationExtensions.cs @@ -13,7 +13,7 @@ namespace Umbraco.Core.Security /// /// Extensions to create and renew and remove authentication tickets for the Umbraco back office /// - internal static class AuthenticationExtensions + public static class AuthenticationExtensions { /// /// This will check the ticket to see if it is valid, if it is it will set the current thread's user and culture @@ -130,10 +130,10 @@ namespace Umbraco.Core.Security } /// - /// This clears the forms authentication cookie + /// This clears the forms authentication cookie for webapi since cookies are handled differently /// /// - public static void UmbracoLogout(this HttpResponseMessage response) + public static void UmbracoLogoutWebApi(this HttpResponseMessage response) { if (response == null) throw new ArgumentNullException("response"); //remove the cookie diff --git a/src/Umbraco.Core/Security/UserData.cs b/src/Umbraco.Core/Security/UserData.cs index 4c05cd6312..ff49636217 100644 --- a/src/Umbraco.Core/Security/UserData.cs +++ b/src/Umbraco.Core/Security/UserData.cs @@ -8,7 +8,7 @@ namespace Umbraco.Core.Security /// [DataContract(Name = "userData", Namespace = "")] [Serializable] - internal class UserData + public class UserData { public UserData() { diff --git a/src/Umbraco.Web/Security/WebSecurity.cs b/src/Umbraco.Web/Security/WebSecurity.cs index 3ccfbaa382..663aa3567e 100644 --- a/src/Umbraco.Web/Security/WebSecurity.cs +++ b/src/Umbraco.Web/Security/WebSecurity.cs @@ -105,9 +105,9 @@ namespace Umbraco.Web.Security /// /// /// returns the number of seconds until their session times out - internal FormsAuthenticationTicket PerformLogin(IUser user) + public FormsAuthenticationTicket PerformLogin(IUser user) { - var ticket = _httpContext.CreateUmbracoAuthTicket(new UserData(Guid.NewGuid().ToString("N")) + var ticket = _httpContext.CreateUmbracoAuthTicket(new UserData() { Id = user.Id, AllowedApplications = user.AllowedSections.ToArray(), @@ -147,7 +147,7 @@ namespace Umbraco.Web.Security /// /// /// - internal bool ValidateBackOfficeCredentials(string username, string password) + public bool ValidateBackOfficeCredentials(string username, string password) { var membershipProvider = Core.Security.MembershipProviderExtensions.GetUsersMembershipProvider(); return membershipProvider != null && membershipProvider.ValidateUser(username, password); @@ -159,7 +159,7 @@ namespace Umbraco.Web.Security /// /// /// - internal MembershipUser GetBackOfficeMembershipUser(string username, bool setOnline) + public MembershipUser GetBackOfficeMembershipUser(string username, bool setOnline) { var membershipProvider = Core.Security.MembershipProviderExtensions.GetUsersMembershipProvider(); return membershipProvider != null ? membershipProvider.GetUser(username, setOnline) : null; diff --git a/src/Umbraco.Web/WebApi/Filters/UmbracoBackOfficeLogoutAttribute.cs b/src/Umbraco.Web/WebApi/Filters/UmbracoBackOfficeLogoutAttribute.cs index 9d49e24776..ecde11023b 100644 --- a/src/Umbraco.Web/WebApi/Filters/UmbracoBackOfficeLogoutAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/UmbracoBackOfficeLogoutAttribute.cs @@ -17,7 +17,7 @@ namespace Umbraco.Web.WebApi.Filters { if (context.Response == null) return; if (context.Response.IsSuccessStatusCode == false) return; - context.Response.UmbracoLogout(); + context.Response.UmbracoLogoutWebApi(); } } } \ No newline at end of file