Romano
Romano

Reputation: 51

How long does stargate rest api's auth token will remain active before expiring?

We are using stargate rest api, which is a wrapper over DataStax Enterprise for Cassandra DB. For accessing the data in the DB, we had get a token from the stargate's auth service first. I wonder how long does this token remain active. Is there a timeline, or does it expire after certain interval of inactivity? Please suggest.

Upvotes: 3

Views: 329

Answers (1)

dwettlaufer
dwettlaufer

Reputation: 378

By default this token will persist for 30 minutes on a sliding window. This means that if you create a token and then wait 29 minutes before using it to authenticate a request to any of the APIs the time to live will be reset to 30 minutes. Likewise, if you wait 31 minutes after creating the token to use it then you'll receive an error because the token no longer exists. The length of time that the token persists can be configured using the stargate.auth_tokenttl system property. As example start up configuration that would set the tokens to persist for 100 seconds would be as follows.

JAVA_OPTS='-Dstargate.auth_tokenttl=100' ./starctl \
--developer-mode --cluster-name test --cluster-version 3.11 --enable-auth

Upvotes: 3

Related Questions