Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gautam Soni 1 post 21 karma points
    Aug 29, 2024 @ 11:37
    Gautam Soni
    0

    Umbraco 14 Backoffice is not being logged in after logging in to Hangfire

    I am trying to upgrade my project from 13 to 14. I have noticed some things that may be useful for me to solve this issue:

    For the first instance when I run backoffice it authorizes it by sending Bearer token in the request. enter image description here

    But when I run hangfire and authenticate it with Basic Authentication by configuring this :

      app.UseEndpoints(endpoints =>
      {
          endpoints.MapControllers();
          endpoints.MapHangfireDashboard("/hangfire", new DashboardOptions()
          {
              Authorization = [
                new HangfireCustomBasicAuthenticationFilter{
                       User = _config.GetSection("HangfireCredentials:UserName").Value,
                       Pass = _config.GetSection("HangfireCredentials:Password").Value
                                     }],
              IgnoreAntiforgeryToken = true
          });
      });
    

    It sends Authorization header with Basic token to all requests on /Hangfire (which is okay): enter image description here

    But when I refresh umbraco backoffice again, it sends Basic token instead of Bearer which causes it not to be logged in to backoffice and asks to enter credentials via alter pop up box (which Umbraco never asks): enter image description here

    If anyone can help me to solve this issue then please. Thanks in advance🙂

Please Sign in or register to post replies

Write your reply to:

Draft