Skip to content
Ona Docs

RegenerateSCIMToken

client.Organizations.ScimConfigurations.RegenerateToken(ctx, body) (*OrganizationScimConfigurationRegenerateTokenResponse, error)
POST/gitpod.v1.OrganizationService/RegenerateSCIMToken

Regenerates the bearer token for a SCIM configuration.

Use this method to:

  • Rotate SCIM credentials
  • Recover from token compromise
  • Update IdP configuration

Examples

  • Regenerate token:

    Creates a new bearer token with the same expiration duration as the previous token.

    scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
  • Regenerate token with new expiration:

    Creates a new bearer token with a custom 180-day expiration.

    scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
    tokenExpiresIn: "15552000s"
ParametersExpand Collapse
body OrganizationScimConfigurationRegenerateTokenParams
ScimConfigurationID param.Field[string]

scim_configuration_id is the ID of the SCIM configuration to regenerate token for

formatuuid
TokenExpiresIn param.Field[string]Optional

token_expires_in is the duration until the new token expires. If not specified, uses the same duration as the previous token.

formatregex
ReturnsExpand Collapse
type OrganizationScimConfigurationRegenerateTokenResponse struct{…}
Token string

token is the new bearer token for SCIM API authentication. This invalidates the previous token - store it securely.

TokenExpiresAt Time

token_expires_at is when the new token will expire

formatdate-time

RegenerateSCIMToken

package main

import (
  "context"
  "fmt"

  "github.com/gitpod-io/gitpod-sdk-go"
  "github.com/gitpod-io/gitpod-sdk-go/option"
)

func main() {
  client := gitpod.NewClient(
    option.WithBearerToken("My Bearer Token"),
  )
  response, err := client.Organizations.ScimConfigurations.RegenerateToken(context.TODO(), gitpod.OrganizationScimConfigurationRegenerateTokenParams{
    ScimConfigurationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Token)
}
{
  "token": "token",
  "tokenExpiresAt": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "token": "token",
  "tokenExpiresAt": "2019-12-27T18:11:19.117Z"
}