Skip to content

Azure Authentication results in 404 (inconsistently) #7394

@fishter

Description

@fishter

Describe the bug
I enabled Azure authentication many versions and months ago. Recently I have seen an occasional 404 error after the login button is pressed. The frequency of these 404 errors appears to be increasing. At first I thought it was correlated with my use of a particular VPN, or network connection, but that seems to have been a red herring.

To Reproduce
Steps to reproduce the behavior:

  1. Open the login page for mesh central
  2. Click on the Microsoft login icon
  3. (optional) pick the right account to use for sign in.
  4. See error 404 page. The URL appears to be double-encoded...
    https:///%2Fauth-azure-callback%3Fcode%3D1.AXoAizEgpnSl0kyqD5u8IsNpUJoSP

Expected behavior
I expect the log in to proceed to the main view, but I get stuck at this 404 page. The login has suceeded on the Azure end, but the callback to Mesh Central has failed in some way. Using a local account instead of the Azure login works.

Server Software (please complete the following information):

  • OS: Amazon Linux 2023
  • Virtualization: none
  • Network: WAN
  • Version: 1.1.49
  • Node: 22.14.0

Client Device (please complete the following information):

  • Device: Laptop
  • OS: Windows
  • Network: Remote, variously through home ISP, VPN to main office ISP, office ISP, etc...
  • Browser: Chrome 141.0.7390.123

Additional context
Annoyingly, this is not a consistent error. For instance, while writing this bug report, I tried it in Edge browser and it worked. Then I went back to Chrome and it also worked after failing for over an hour and >10 attempts.

Your config.json file

{
  "$schema": "https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json",
  "__comment1__": "This is a simple configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
  "__comment2__": "See node_modules/meshcentral/sample-config-advanced.json for a more advanced example.",
  "settings": {
    "cert": "redact",
    "WANonly": true,
    "_LANonly": true,
    "sessionKey": "secret",
    "_port": 443,
    "_aliasPort": 443,
    "_redirPort": 80,
    "_redirAliasPort": 80,
    "relayPort": 453,
    "_syslog": "meshcentral",
    "Minify" : true,
    "Compression" : true,
    "webRTC": true,
    "wsCompression":true,
    "agentPing" : 50,
    "agentWsCompression":true,
    "_debug": "*",
    "dbExpire" : {
      "events" : 5184000
    },
    "_maxInvalidLogin" : {
      "time": 10,
      "count": 10,
      "coolofftime":10
      }
  },
  "domains": {
    "": {
      "title": "Access",
      "title2": "Europe",
      "allowedOrigin": "redact",
      "_minify": true,
      "NewAccounts": false,
      "_userNameIsEmail": true,
      "authStrategies": {
        "azure": {
          "callbackurl": "https://<domain>/auth-azure-callback",
          "newAccounts" : true,
          "clientid": "xxx",
          "clientsecret": "xxx",
          "tenantid": "xxx"
        }
      },
      "agentCustomization": {
        "displayName": "xxx",
        "descripton": "Agent for Europe server",
        "companyName": "xxx",
        "serviceName": "xxx",
        "fileName": "xxx"
      },
      "ssh" : true
    }
  },
  "letsencrypt": {
    "__comment__": "Requires NodeJS 8.x or better, Go to https://letsdebug.net/ first before trying Let's Encrypt.",
    "email": "redact@redact.fr",
    "names": "redact,redact",
    "rsaKeySize" : 3072,
    "production": true
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions