rockerby
01/23/2024, 5:40 PMUmbracoAPIController and the UmbracoMemberAuthorize attribute.
public class MyController : UmbracoApiController
{
  // ...
  [HttpGet]
  [UmbracoMemberAuthorize]
  public async Task<IActionResult> MyFunction(string param1)
  {
    // Some code!
  }
}
The above gives me an empty 401 response code and I'm trying to redirect the user back to the login page. I could take the [UmbracoMemberAuthorize] attribute off and deal with auth myself, but feels like there should be a better solution that I don't understand.
I've tried the solution here https://our.umbraco.com/forum/using-umbraco-and-getting-started/111100-umbraco-10-redirect-unauthenticated-user-challange-result-to-an-umbraco-page but this hasn't worked. Perhaps it's as I'm using OpenID, but authorizeResult is always giving a Succeeded.
Any pointers on this would be really helpful!D_Inventor
01/24/2024, 9:39 AMA hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by