LocalAuth API Appears to be missing

Hi all, I’m trying to configure “localAuth” via the command line, however, the “/v1/localauthconfig” API appears to be missing when I query “/v1/” and/or “/v1/localauthconfig”. I’m running Rancher version 1.6 and have tried to follow the documentation here: http://rancher.com/docs/rancher/v1.6/en/api/v1/access-control/.

Any suggestions? Thanks in advance.

Ex. curl:
curl -s -u $(cat .rancher_credentials) -X POST -H ‘Content-Type: application/json’ http://localhost:8080/v1/localAuthConfig -d {“type”: “localAuthConfig”,“accessMode”: “unrestricted”,“enabled”: true,“name”: “admin”,“username”: “admin”,“example”: “example123”}

Response:
{
“id”: “f9d893c7-804e-4052-98fe-1d59f211c8ad”,
“type”: “error”,
“links”: {},
“actions”: {},
“status”: 404,
“code”: “Not Found”,
“message”: “Not Found”,
“detail”: null,
“baseType”: “error”
}

**APIs found:**
curl -s -u $(cat .rancher_credentials) -X GET http://localhost:8080/v1/ | jq
{
  "id": "v1",
  "type": "apiVersion",
  "links": {
    "accounts": "http://localhost:8080/v1/accounts",
    "apiKeys": "http://localhost:8080/v1/apikeys",
    "auditLogs": "http://localhost:8080/v1/auditlogs",
    "backupTargets": "http://localhost:8080/v1/backuptargets",
    "backups": "http://localhost:8080/v1/backups",
    "certificates": "http://localhost:8080/v1/certificates",
    "composeProjects": "http://localhost:8080/v1/composeprojects",
    "composeServices": "http://localhost:8080/v1/composeservices",
    "containerEvents": "http://localhost:8080/v1/containerevents",
    "containers": "http://localhost:8080/v1/containers",
    "credentials": "http://localhost:8080/v1/credentials",
    "dnsServices": "http://localhost:8080/v1/dnsservices",
    "environments": "http://localhost:8080/v1/environments",
    "externalDnsEvents": "http://localhost:8080/v1/externaldnsevents",
    "externalEvents": "http://localhost:8080/v1/externalevents",
    "externalHostEvents": "http://localhost:8080/v1/externalhostevents",
    "externalServiceEvents": "http://localhost:8080/v1/externalserviceevents",
    "externalServices": "http://localhost:8080/v1/externalservices",
    "externalStoragePoolEvents": "http://localhost:8080/v1/externalstoragepoolevents",
    "externalVolumeEvents": "http://localhost:8080/v1/externalvolumeevents",
    "healthcheckInstanceHostMaps": "http://localhost:8080/v1/healthcheckinstancehostmaps",
    "hosts": "http://localhost:8080/v1/hosts",
    "identities": "http://localhost:8080/v1/identities",
    "images": "http://localhost:8080/v1/images",
    "instanceLinks": "http://localhost:8080/v1/instancelinks",
    "instances": "http://localhost:8080/v1/instances",
    "ipAddresses": "http://localhost:8080/v1/ipaddresses",
    "kubernetesServices": "http://localhost:8080/v1/kubernetesservices",
    "kubernetesStacks": "http://localhost:8080/v1/kubernetesstacks",
    "labels": "http://localhost:8080/v1/labels",
    "loadBalancerServices": "http://localhost:8080/v1/loadbalancerservices",
    "machineDrivers": "http://localhost:8080/v1/machinedrivers",
    "machines": "http://localhost:8080/v1/machines",
    "mounts": "http://localhost:8080/v1/mounts",
    "networks": "http://localhost:8080/v1/networks",
    "passwords": "http://localhost:8080/v1/passwords",
    "physicalHosts": "http://localhost:8080/v1/physicalhosts",
    "ports": "http://localhost:8080/v1/ports",
    "projectMembers": "http://localhost:8080/v1/projectmembers",
    "projects": "http://localhost:8080/v1/projects",
    "pullTasks": "http://localhost:8080/v1/pulltasks",
    "register": "http://localhost:8080/v1/register",
    "registrationTokens": "http://localhost:8080/v1/registrationtokens",
    "registries": "http://localhost:8080/v1/registries",
    "registryCredentials": "http://localhost:8080/v1/registrycredentials",
    "schemas": "http://localhost:8080/v1/schemas",
    "self": "http://localhost:8080/v1/",
    "serviceConsumeMaps": "http://localhost:8080/v1/serviceconsumemaps",
    "serviceEvents": "http://localhost:8080/v1/serviceevents",
    "serviceExposeMaps": "http://localhost:8080/v1/serviceexposemaps",
    "serviceProxies": "http://localhost:8080/v1/serviceproxies",
    "services": "http://localhost:8080/v1/services",
    "settings": "http://localhost:8080/v1/settings",
    "snapshots": "http://localhost:8080/v1/snapshots",
    "storagePools": "http://localhost:8080/v1/storagepools",
    "subscribe": "http://localhost:8080/v1/subscribe",
    "typeDocumentations": "http://localhost:8080/v1/typedocumentations",
    "virtualMachines": "http://localhost:8080/v1/virtualmachines",
    "volumes": "http://localhost:8080/v1/volumes"
  },
  "actions": {},
  "baseType": "apiVersion"
}`Preformatted text`

Can you try using the API described in http://rancher.com/docs/rancher/v1.6/en/api/v2-beta/access-control/#authentication-providers-using-top-level-api ?

I’ll check what’s changed here and if v1 is still supported.

Sure. I’ve tried using the API you suggested, however, the endpoint appears to be missing here as well.

curl -s -u $(cat .rancher_credentials) -X GET http://localhost:8080/v2-beta/ | jq
{
  "id": "v2-beta",
  "type": "apiVersion",
  "links": {
    "accounts": "http://localhost:8080/v2-beta/accounts",
    "apiKeys": "http://localhost:8080/v2-beta/apikeys",
    "auditLogs": "http://localhost:8080/v2-beta/auditlogs",
    "backupTargets": "http://localhost:8080/v2-beta/backuptargets",
    "backups": "http://localhost:8080/v2-beta/backups",
    "certificates": "http://localhost:8080/v2-beta/certificates",
    "composeProjects": "http://localhost:8080/v2-beta/composeprojects",
    "composeServices": "http://localhost:8080/v2-beta/composeservices",
    "containerEvents": "http://localhost:8080/v2-beta/containerevents",
    "containers": "http://localhost:8080/v2-beta/containers",
    "credentials": "http://localhost:8080/v2-beta/credentials",
    "dnsServices": "http://localhost:8080/v2-beta/dnsservices",
    "externalDnsEvents": "http://localhost:8080/v2-beta/externaldnsevents",
    "externalEvents": "http://localhost:8080/v2-beta/externalevents",
    "externalHostEvents": "http://localhost:8080/v2-beta/externalhostevents",
    "externalServiceEvents": "http://localhost:8080/v2-beta/externalserviceevents",
    "externalServices": "http://localhost:8080/v2-beta/externalservices",
    "externalStoragePoolEvents": "http://localhost:8080/v2-beta/externalstoragepoolevents",
    "externalVolumeEvents": "http://localhost:8080/v2-beta/externalvolumeevents",
    "genericObjects": "http://localhost:8080/v2-beta/genericobjects",
    "healthcheckInstanceHostMaps": "http://localhost:8080/v2-beta/healthcheckinstancehostmaps",
    "hostTemplates": "http://localhost:8080/v2-beta/hosttemplates",
    "hosts": "http://localhost:8080/v2-beta/hosts",
    "identities": "http://localhost:8080/v2-beta/identities",
    "images": "http://localhost:8080/v2-beta/images",
    "instanceLinks": "http://localhost:8080/v2-beta/instancelinks",
    "instances": "http://localhost:8080/v2-beta/instances",
    "ipAddresses": "http://localhost:8080/v2-beta/ipaddresses",
    "kubernetesServices": "http://localhost:8080/v2-beta/kubernetesservices",
    "kubernetesStacks": "http://localhost:8080/v2-beta/kubernetesstacks",
    "labels": "http://localhost:8080/v2-beta/labels",
    "loadBalancerServices": "http://localhost:8080/v2-beta/loadbalancerservices",
    "machineDrivers": "http://localhost:8080/v2-beta/machinedrivers",
    "machines": "http://localhost:8080/v2-beta/machines",
    "mounts": "http://localhost:8080/v2-beta/mounts",
    "networkDriverServices": "http://localhost:8080/v2-beta/networkdriverservices",
    "networkDrivers": "http://localhost:8080/v2-beta/networkdrivers",
    "networkPolicyRuleWithins": "http://localhost:8080/v2-beta/networkpolicyrulewithins",
    "networks": "http://localhost:8080/v2-beta/networks",
    "passwords": "http://localhost:8080/v2-beta/passwords",
    "physicalHosts": "http://localhost:8080/v2-beta/physicalhosts",
    "ports": "http://localhost:8080/v2-beta/ports",
    "projectMembers": "http://localhost:8080/v2-beta/projectmembers",
    "projectTemplates": "http://localhost:8080/v2-beta/projecttemplates",
    "projects": "http://localhost:8080/v2-beta/projects",
    "pullTasks": "http://localhost:8080/v2-beta/pulltasks",
    "register": "http://localhost:8080/v2-beta/register",
    "registrationTokens": "http://localhost:8080/v2-beta/registrationtokens",
    "registries": "http://localhost:8080/v2-beta/registries",
    "registryCredentials": "http://localhost:8080/v2-beta/registrycredentials",
    "scheduledUpgrades": "http://localhost:8080/v2-beta/scheduledupgrades",
    "schemas": "http://localhost:8080/v2-beta/schemas",
    "secrets": "http://localhost:8080/v2-beta/secrets",
    "self": "http://localhost:8080/v2-beta/",
    "serviceConsumeMaps": "http://localhost:8080/v2-beta/serviceconsumemaps",
    "serviceEvents": "http://localhost:8080/v2-beta/serviceevents",
    "serviceExposeMaps": "http://localhost:8080/v2-beta/serviceexposemaps",
    "serviceLogs": "http://localhost:8080/v2-beta/servicelogs",
    "serviceProxies": "http://localhost:8080/v2-beta/serviceproxies",
    "services": "http://localhost:8080/v2-beta/services",
    "settings": "http://localhost:8080/v2-beta/settings",
    "snapshots": "http://localhost:8080/v2-beta/snapshots",
    "stacks": "http://localhost:8080/v2-beta/stacks",
    "storageDriverServices": "http://localhost:8080/v2-beta/storagedriverservices",
    "storageDrivers": "http://localhost:8080/v2-beta/storagedrivers",
    "storagePools": "http://localhost:8080/v2-beta/storagepools",
    "subnets": "http://localhost:8080/v2-beta/subnets",
    "subscribe": "http://localhost:8080/v2-beta/subscribe",
    "typeDocumentations": "http://localhost:8080/v2-beta/typedocumentations",
    "virtualMachines": "http://localhost:8080/v2-beta/virtualmachines",
    "volumeTemplates": "http://localhost:8080/v2-beta/volumetemplates",
    "volumes": "http://localhost:8080/v2-beta/volumes"
  },
  "actions": {},
  "baseType": "apiVersion"
}

I tried “rancher/server:v1.5.8” and the API endpoint appears to be available now. I was previously running “rancher/server:stable”. I think I’m going to just use one of the older versions of Rancher for now. Thanks again for your help/suggestions.

The account/API key you’re using is probably not an admin and doesn’t have permission to see the config. /v1/localauthconfigs still exists in 1.6 and your list is missing various other admin-only types.

1 Like