---
type: api
title: Initiate SAML protocol
description: Calls the authentication cluster to initiate SAML Single Sign-on (Web Browser SSO profile) protocol and redirects the user to the identity provider for authentication. The authentication cluster must be configured prior to initiation.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/operation/operation-saml-init
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/operation/operation-saml-init
products:
  - Elastic Cloud Enterprise
---

# Initiate SAML protocol

## Paths

- `GET` `/users/auth/saml/_init`

## Description

Calls the authentication cluster to initiate SAML Single Sign-on (Web Browser SSO profile) protocol and redirects the user to the identity provider for authentication. The authentication cluster must be configured prior to initiation.

## Authentication

- Basic: `Authorization: Basic <credentials>`
- Api key: `Authorization: <value>`

## Query string parameters

- `state` (string) — optional
  An optional relay state that is sent back to the client after the user is authenticated
- `realm` (string) — optional
  An optional SAML realm to use for authentication

## Responses

#### `302`

Redirects the client to the identity provider with a SAML authentication request

`application/json`

Type: `object`

#### `501`

The administrator needs to configure the authentication cluster. (code: `authc.no_authentication_cluster`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `502`

The authentication cluster failed to process the request. The response body contains details about the error. (code: `authc.authentication_cluster_error`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code examples

#### curl

```curl
curl -X GET "${API_URL}/users/auth/saml/_init" \
  -u "${USERNAME}:${PASSWORD}"
```

