2 Replies Latest reply on Jul 22, 2019 9:52 AM by Felipe Locci

    Use specific domain to login - Automation API

    Felipe Locci
      Share:|

      Hello,

       

      How can I specify a domain to login when using a REST service with the automation API?

      I have already set a Default LDAP Domain in CCM.

       

      The code is something like:

       

      #endpoint=https://<ip>:8443/automation-api

       

      ip=$1

      user=$2

      passwd=$3

      endpoint=https://${ip}:8443/automation-api
      login=$(curl -k -H "Content-Type: application/json" -X POST -d "{\"username\":\"$user\",\"password\":\"$passwd\"}" "$endpoint/session/login" )

      token=$(echo ${login##*token\":\"} | cut -d '"' -f 1)

       

      user=<DOMAIN>/<LOGIN> does not work.

      user=<LOGIN> does work, but only for the default LDAP Domain.

       

      Any insights?