Skip to main content

Account resource

Request a new refresh token

warning

This function is only available to users with Sentry Interactive issued auth tokens.

info
  • When used successfully, the cloud auth token and cloud refresh token from the response are added to the context manager and automatically stored in secure storage.
  • This function can be used with the refresh token value from the context. To use the value from the context, you should pass null as the function parameter.
// Returns a TokenResponse
val response = sdk.account().refreshToken("REFRESH_TOKEN")

Logout

warning

When used, the context manager restarts, and the values from the secure storage are automatically deleted.

// Returns Unit
sdk.account().logout()

Register ephemeral key

To register a new ephemeral key, you will need to generate a new key pair.

info
  • When used successfully, both the supplied private and public keys are added to the context manager and automatically stored in secure storage, along with the user ID and user certificate chain from the response.
  • If your context manager already has public and private keys, you can pass null for those parameters, and those values will be retrieved from the context manager instead.
// Returns a RegisterEphemeralKeyResponse
val response = sdk.account().registerEphemeralKey(KEY_PAIR)

Register ephemeral key with secondary authentication

To register a new ephemeral key with secondary authentication, you will need to generate a new key pair. After the registration, you will need to verify the ephemeral key registration.

info

If your context manager already has public key, you can pass null for that parameter, and the value will be retrieved from the context manager instead.

// Returns a RegisterEphemeralKeyWithSecondaryAuthenticationResponse
val response = sdk.account().registerEphemeralKeyWithSecondaryAuthentication(PUBLIC_KEY)

Verify ephemeral key registration

info
  • When used successfully, both the supplied private and public keys are added to the context manager and automatically stored in secure storage, along with the user ID and user certificate chain from the response.
  • If your context manager already has public and private keys, you can pass null for those parameters, and those values will be retrieved from the context manager instead.
// Returns a RegisterEphemeralKeyResponse
val response = sdk.account().verifyEphemeralKeyRegistration(
code = "CODE",
keyPair = KEY_PAIR
)

Re-verify email

warning

This function is only available to users with Sentry Interactive issued auth tokens.

// Returns Unit
sdk.account().reverifyEmail()

Change password

warning

This function is only available to users with Sentry Interactive issued auth tokens.

// Returns Unit
sdk.account().changePassword(
oldPassword = "OLD_PASSWORD",
newPassword = "NEW_PASSWORD"
)

Get user details

// Returns a UserDetailsResponse
val response = sdk.account().getUserDetails()

Update user details

// Returns Unit
sdk.account().updateUserDetails("DISPLAY_NAME")

Delete account

danger

This operation is executed instantly and is irreversible.

info

When used, the context manager restarts, and the values from the secure storage are automatically deleted.

// Returns Unit
sdk.account().deleteAccount()