# SSO ## Get all SSO connectors `client.IAM.SSO.List(ctx, query) (*SinglePage[SSOListResponse], error)` **get** `/accounts/{account_id}/sso_connectors` Get all SSO connectors ### Parameters - `query SSOListParams` - `AccountID param.Field[string]` Account identifier tag. ### Returns - `type SSOListResponse struct{…}` - `ID string` SSO Connector identifier tag. - `CreatedOn Time` Timestamp for the creation of the SSO connector - `EmailDomain string` - `Enabled bool` - `UpdatedOn Time` Timestamp for the last update of the SSO connector - `UseFedrampLanguage bool` Controls the display of FedRAMP language to the user during SSO login - `Verification SSOListResponseVerification` - `Code string` DNS verification code. Add this entire string to the DNS TXT record of the email domain to validate ownership. - `Status SSOListResponseVerificationStatus` The status of the verification code from the verification process. - `const SSOListResponseVerificationStatusAwaiting SSOListResponseVerificationStatus = "awaiting"` - `const SSOListResponseVerificationStatusPending SSOListResponseVerificationStatus = "pending"` - `const SSOListResponseVerificationStatusFailed SSOListResponseVerificationStatus = "failed"` - `const SSOListResponseVerificationStatusVerified SSOListResponseVerificationStatus = "verified"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/iam" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.IAM.SSO.List(context.TODO(), iam.SSOListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_on": "2025-01-01T12:21:02.0000Z", "email_domain": "example.com", "enabled": false, "updated_on": "2025-01-01T12:21:02.0000Z", "use_fedramp_language": false, "verification": { "code": "cloudflare_dashboard_sso=023e105f4ecef8ad9ca31a8372d0c353", "status": "pending" } } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get single SSO connector `client.IAM.SSO.Get(ctx, ssoConnectorID, query) (*SSOGetResponse, error)` **get** `/accounts/{account_id}/sso_connectors/{sso_connector_id}` Get single SSO connector ### Parameters - `ssoConnectorID string` SSO Connector identifier tag. - `query SSOGetParams` - `AccountID param.Field[string]` Account identifier tag. ### Returns - `type SSOGetResponse struct{…}` - `ID string` SSO Connector identifier tag. - `CreatedOn Time` Timestamp for the creation of the SSO connector - `EmailDomain string` - `Enabled bool` - `UpdatedOn Time` Timestamp for the last update of the SSO connector - `UseFedrampLanguage bool` Controls the display of FedRAMP language to the user during SSO login - `Verification SSOGetResponseVerification` - `Code string` DNS verification code. Add this entire string to the DNS TXT record of the email domain to validate ownership. - `Status SSOGetResponseVerificationStatus` The status of the verification code from the verification process. - `const SSOGetResponseVerificationStatusAwaiting SSOGetResponseVerificationStatus = "awaiting"` - `const SSOGetResponseVerificationStatusPending SSOGetResponseVerificationStatus = "pending"` - `const SSOGetResponseVerificationStatusFailed SSOGetResponseVerificationStatus = "failed"` - `const SSOGetResponseVerificationStatusVerified SSOGetResponseVerificationStatus = "verified"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/iam" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) sso, err := client.IAM.SSO.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", iam.SSOGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", sso.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_on": "2025-01-01T12:21:02.0000Z", "email_domain": "example.com", "enabled": false, "updated_on": "2025-01-01T12:21:02.0000Z", "use_fedramp_language": false, "verification": { "code": "cloudflare_dashboard_sso=023e105f4ecef8ad9ca31a8372d0c353", "status": "pending" } } } ``` ## Initialize new SSO connector `client.IAM.SSO.New(ctx, params) (*SSONewResponse, error)` **post** `/accounts/{account_id}/sso_connectors` Initialize new SSO connector ### Parameters - `params SSONewParams` - `AccountID param.Field[string]` Path param: Account identifier tag. - `EmailDomain param.Field[string]` Body param: Email domain of the new SSO connector - `BeginVerification param.Field[bool]` Body param: Begin the verification process after creation - `UseFedrampLanguage param.Field[bool]` Body param: Controls the display of FedRAMP language to the user during SSO login ### Returns - `type SSONewResponse struct{…}` - `ID string` SSO Connector identifier tag. - `CreatedOn Time` Timestamp for the creation of the SSO connector - `EmailDomain string` - `Enabled bool` - `UpdatedOn Time` Timestamp for the last update of the SSO connector - `UseFedrampLanguage bool` Controls the display of FedRAMP language to the user during SSO login - `Verification SSONewResponseVerification` - `Code string` DNS verification code. Add this entire string to the DNS TXT record of the email domain to validate ownership. - `Status SSONewResponseVerificationStatus` The status of the verification code from the verification process. - `const SSONewResponseVerificationStatusAwaiting SSONewResponseVerificationStatus = "awaiting"` - `const SSONewResponseVerificationStatusPending SSONewResponseVerificationStatus = "pending"` - `const SSONewResponseVerificationStatusFailed SSONewResponseVerificationStatus = "failed"` - `const SSONewResponseVerificationStatusVerified SSONewResponseVerificationStatus = "verified"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/iam" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) sso, err := client.IAM.SSO.New(context.TODO(), iam.SSONewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), EmailDomain: cloudflare.F("example.com"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", sso.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_on": "2025-01-01T12:21:02.0000Z", "email_domain": "example.com", "enabled": false, "updated_on": "2025-01-01T12:21:02.0000Z", "use_fedramp_language": false, "verification": { "code": "cloudflare_dashboard_sso=023e105f4ecef8ad9ca31a8372d0c353", "status": "pending" } } } ``` ## Update SSO connector state `client.IAM.SSO.Update(ctx, ssoConnectorID, params) (*SSOUpdateResponse, error)` **patch** `/accounts/{account_id}/sso_connectors/{sso_connector_id}` Update SSO connector state ### Parameters - `ssoConnectorID string` SSO Connector identifier tag. - `params SSOUpdateParams` - `AccountID param.Field[string]` Path param: Account identifier tag. - `Enabled param.Field[bool]` Body param: SSO Connector enabled state - `UseFedrampLanguage param.Field[bool]` Body param: Controls the display of FedRAMP language to the user during SSO login ### Returns - `type SSOUpdateResponse struct{…}` - `ID string` SSO Connector identifier tag. - `CreatedOn Time` Timestamp for the creation of the SSO connector - `EmailDomain string` - `Enabled bool` - `UpdatedOn Time` Timestamp for the last update of the SSO connector - `UseFedrampLanguage bool` Controls the display of FedRAMP language to the user during SSO login - `Verification SSOUpdateResponseVerification` - `Code string` DNS verification code. Add this entire string to the DNS TXT record of the email domain to validate ownership. - `Status SSOUpdateResponseVerificationStatus` The status of the verification code from the verification process. - `const SSOUpdateResponseVerificationStatusAwaiting SSOUpdateResponseVerificationStatus = "awaiting"` - `const SSOUpdateResponseVerificationStatusPending SSOUpdateResponseVerificationStatus = "pending"` - `const SSOUpdateResponseVerificationStatusFailed SSOUpdateResponseVerificationStatus = "failed"` - `const SSOUpdateResponseVerificationStatusVerified SSOUpdateResponseVerificationStatus = "verified"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/iam" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) sso, err := client.IAM.SSO.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", iam.SSOUpdateParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", sso.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_on": "2025-01-01T12:21:02.0000Z", "email_domain": "example.com", "enabled": false, "updated_on": "2025-01-01T12:21:02.0000Z", "use_fedramp_language": false, "verification": { "code": "cloudflare_dashboard_sso=023e105f4ecef8ad9ca31a8372d0c353", "status": "pending" } } } ``` ## Delete SSO connector `client.IAM.SSO.Delete(ctx, ssoConnectorID, body) (*SSODeleteResponse, error)` **delete** `/accounts/{account_id}/sso_connectors/{sso_connector_id}` Delete SSO connector ### Parameters - `ssoConnectorID string` SSO Connector identifier tag. - `body SSODeleteParams` - `AccountID param.Field[string]` Account identifier tag. ### Returns - `type SSODeleteResponse struct{…}` - `ID string` Identifier ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/iam" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) sso, err := client.IAM.SSO.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", iam.SSODeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", sso.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353" } } ``` ## Begin SSO connector verification `client.IAM.SSO.BeginVerification(ctx, ssoConnectorID, body) (*SSOBeginVerificationResponse, error)` **post** `/accounts/{account_id}/sso_connectors/{sso_connector_id}/begin_verification` Begin SSO connector verification ### Parameters - `ssoConnectorID string` SSO Connector identifier tag. - `body SSOBeginVerificationParams` - `AccountID param.Field[string]` Account identifier tag. ### Returns - `type SSOBeginVerificationResponse struct{…}` - `Errors []SSOBeginVerificationResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source SSOBeginVerificationResponseErrorsSource` - `Pointer string` - `Messages []SSOBeginVerificationResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source SSOBeginVerificationResponseMessagesSource` - `Pointer string` - `Success SSOBeginVerificationResponseSuccess` Whether the API call was successful. - `const SSOBeginVerificationResponseSuccessTrue SSOBeginVerificationResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/iam" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.IAM.SSO.BeginVerification( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", iam.SSOBeginVerificationParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ```