XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    xoa token expire date - how can i set it to an later date?

    Scheduled Pinned Locked Moved Xen Orchestra
    7 Posts 3 Posters 1.0k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V Offline
      vmpr
      last edited by

      Hi Team,
      i want to use the xoa api to monitor if i have old or too many snapshots connected to an VM, thank you for implementing the feature to your API that it is possible now. I check it via icinga and need an token which expires in 5 years or something and not after a month. when I try to create a user in the webfrontend admin user with a date 5 years or 11 month from now, it logs an error with:

      too high expiresIn duration: 1956120152841
      

      I also tried to create the user via cli:

      #create timestamp for 5 years from now:
      date +%s -d "5 year"
      1831359954
      
      #create user token
      xo-cli --createToken --allowUnauthorized --expiresIn 1831359954 localhost admin@admin.net
      
      Authentication token created
      
      7kkiyVwzgISlOTO2LozsjtVTDPHG71lvqHEtYeSRQf0
      

      but the expiration date of the token is only 30 days from now.

      I dont want to create a new token every 30 days and reconfigure our icinga monitoring system to work with a new token, so can you please tell me how I can create a tekoen with higher age and maybe put it into the documentation, i was able to find the "--expiresIn" parameter but no info what you should put in there 🙂

      cheers guys! Ringo

      julien-fJ 1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        That's a question for @julien-f 🙂

        1 Reply Last reply Reply Quote 0
        • julien-fJ Offline
          julien-f Vates 🪐 Co-Founder XO Team @vmpr
          last edited by

          @vmpr You need to update authentication.maxTokenValidity in your xo-server's config.

          See https://github.com/vatesfr/xen-orchestra/blob/6c44a94bf4b7adc2d3a46d5a7813f6a675b8f49b/packages/xo-server/config.toml#L46

          V 1 Reply Last reply Reply Quote 0
          • V Offline
            vmpr @julien-f
            last edited by

            @julien-f thanks for the answer! this will get overwritten with every xo source update right? how about a licensed xoa? cheers Ringo

            julien-fJ 1 Reply Last reply Reply Quote 0
            • julien-fJ Offline
              julien-f Vates 🪐 Co-Founder XO Team @vmpr
              last edited by julien-f

              @vmpr Yes, you need to write your settings in your own config file, see https://github.com/vatesfr/xen-orchestra/blob/3c7d316b3cb3e949316e4a93f74da954df81a65f/packages/xo-server/sample.config.toml#L4-L5

              1 Reply Last reply Reply Quote 0
              • olivierlambertO Offline
                olivierlambert Vates 🪐 Co-Founder CEO
                last edited by

                Which is /etc/xo-server/config.toml if you use XOA 🙂

                1 Reply Last reply Reply Quote 1
                • V Offline
                  vmpr
                  last edited by

                  Thanks guys! Absolut Legends 👌

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post