I would like to make a call to the same function that is called on clicking the backoffice sign in button. I am unsure what that would be, if anyone could let me know what I need to call or point me in the right direction please.
After examining the Umbraco source code, I was able to achieve this in front end and backend code.
In front end I created a jQuery ajax call to the following endpoint: '/umbraco/backoffice/UmbracoApi/Authentication/PostLogin'. I also passed in username and password details as JSON object.
In back end I used the following code from a UmbracoApiController:
private async Task<SignInStatus> LoginAsync(LoginModel loginModel)
{
// Get http context
var http = this.TryGetHttpContext();
// Get owin context
var owinContext = TryGetOwinContext().Result;
// Get backoffice sign in manager
var signInManager = TryGetOwinContext().Result.GetBackOfficeSignInManager();
// Call sign in method
var result = await signInManager.PasswordSignInAsync(loginModel.Username, loginModel.Password, true, true);
return result;
}
Umbraco Backoffice Sign in Call
Hi,
I would like to make a call to the same function that is called on clicking the backoffice sign in button. I am unsure what that would be, if anyone could let me know what I need to call or point me in the right direction please.
Thank you in advance.
After examining the Umbraco source code, I was able to achieve this in front end and backend code.
In front end I created a jQuery ajax call to the following endpoint: '/umbraco/backoffice/UmbracoApi/Authentication/PostLogin'. I also passed in username and password details as JSON object.
In back end I used the following code from a UmbracoApiController:
is working on a reply...