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 2.1k 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

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • First post
                    Last post