Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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:
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);
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted