{"record":{"id":"7cb9099eaff80990","repo":"AlistGo/alist","slug":"tld-s-is-not-supported","errorCode":null,"errorMessage":"tld %s is not supported","messagePattern":"tld (.+?) is not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/webdav/odrvcookie/fetch.go","lineNumber":158,"sourceCode":"}\n\nvar loginUrlsMap = map[string]string{\n\t\"com\": \"https://login.microsoftonline.com\",\n\t\"cn\":  \"https://login.chinacloudapi.cn\",\n\t\"us\":  \"https://login.microsoftonline.us\",\n\t\"de\":  \"https://login.microsoftonline.de\",\n}\n\nfunc getLoginUrl(endpoint string) (string, error) {\n\tspRoot, err := url.Parse(endpoint)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdomains := strings.Split(spRoot.Host, \".\")\n\ttld := domains[len(domains)-1]\n\tloginUrl, ok := loginUrlsMap[tld]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"tld %s is not supported\", tld)\n\t}\n\treturn loginUrl + \"/extSTS.srf\", nil\n}\n\nfunc (ca *CookieAuth) getSPToken() (*SuccessResponse, error) {\n\tloginUrl, err := getLoginUrl(ca.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqData := map[string]string{\n\t\t\"Username\": ca.user,\n\t\t\"Password\": ca.pass,\n\t\t\"Address\":  ca.endpoint,\n\t\t\"LoginUrl\": loginUrl,\n\t}\n\n\tt := template.Must(template.New(\"authXML\").Parse(reqString))\n","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/webdav/odrvcookie/fetch.go#L140-L176","documentation":"The odrvcookie WebDAV driver maps a SharePoint endpoint's top-level domain to a Microsoft login URL via a fixed map (com, cn, de, us...). When the endpoint's TLD is not a key in loginUrlsMap, getLoginUrl refuses with 'tld %s is not supported' because no extSTS.srf auth endpoint exists for that cloud.","triggerScenarios":"CookieAuth.getSPToken parsing the configured SharePoint endpoint and finding a TLD outside the map — e.g. endpoints on .fr, .edu, or any custom/government cloud domain not listed.","commonSituations":"Using SharePoint Online in a national/sovereign cloud beyond the supported set, or pointing the endpoint at a custom vanity domain whose last label isn't in the map.","solutions":["Use an endpoint on a supported TLD: sharepoint.com (global), sharepoint.cn (21Vianet), login.microsoftonline.de / .us variants per the map.","If you control the deployment, add the missing TLD->loginUrl mapping to loginUrlsMap in drivers/webdav/odrvcookie/fetch.go and rebuild.","Switch the storage to the standard onedrive/webdav driver if the sovereign cloud is unsupported."],"exampleFix":"// extend the map for a private cloud (drivers/webdav/odrvcookie/fetch.go)\nvar loginUrlsMap = map[string]string{\n  \"com\": \"https://login.microsoftonline.com\",\n  \"cn\": \"https://login.chinacloudapi.cn\",\n  // add:\n  \"fr\": \"https://login.microsoftonline.fr\",\n}","handlingStrategy":"validation","validationCode":"var supportedTLDs = map[string]bool{\"com\": true, \"cn\": true, \"de\": true, \"us\": true}\nfunc endpointSupported(endpoint string) bool {\n    u, err := url.Parse(endpoint)\n    if err != nil { return false }\n    parts := strings.Split(u.Host, \".\")\n    return supportedTLDs[parts[len(parts)-1]]\n}","typeGuard":null,"tryCatchPattern":"if _, err := ca.getSPToken(); err != nil && strings.Contains(err.Error(), \"tld\") && strings.Contains(err.Error(), \"not supported\") {\n    // switch endpoint to a supported sovereign cloud or extend loginUrlsMap\n}","preventionTips":["Use endpoints on sharepoint.com / sovereign clouds present in loginUrlsMap","Avoid custom vanity TLDs for the SharePoint endpoint","Patch loginUrlsMap and rebuild for private clouds"],"tags":["webdav","sharepoint","authentication","unsupported-region"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}