---
title: "Sign in a user via SAML"
url: "https://docs.unified.to/auth/saml/Sign_in_a_user_via_SAML"
description: "API reference for Sign in a user via SAML. Launch multiple pre-built SAML integrations today with zero maintenance — all through a single API."
generated_at: "2026-07-27T21:50:48.366Z"
---
# Sign in a user via SAML

 GET/unified/integration/saml/{workspace\_id}/{integration\_type} NO AUTH NEEDED

Returns a SAML authentication URL for the specified integration. Once a successful authentication occurs, the name and email are returned inside a jwt parameter, which is a JSON web token that is base-64 encoded.

## Parameters

**success\_redirect**string 

The URL where you want the user to be redirect to after a successful authentication/sign-in. A "jwt" parameter will be appended to the URL which will contain a name and email of the user who just signed-in.

**failure\_redirect**string 

The URL where you want the user to be redirect to after an unsuccessful authentication. An "error" variable will be appended.

**state**string 

Extra state to send back to your success URL

**redirect**boolean 

**env**string  default=Production

**workspace\_id**string  required 

The ID of the workspace

**integration\_type**string  required 

Type of the supported integration

## Returns

string

## Code Samples

### Node.js SDK

```
import { UnifiedTo } from '@unified-api/typescript-sdk';

const sdk = new UnifiedTo({
    security: {
        jwt: '<YOUR_API_KEY_HERE>',
    },
});

const results = await sdk.unified.getUnifiedIntegrationSaml({ 
    success_redirect: '',
    failure_redirect: '',
    state: '',
    redirect: false,
    env: 'Production',
 });
```

### Node.js (axios)

```
const options = {
  method: 'GET',
  url: 'https://api.unified.to/unified/integration/saml/5dc620c91e139b20430ad8e0/hubspot',
  params: {
    success_redirect: '',
    failure_redirect: '',
    state: '',
    redirect: false,
    env: 'Production',
  }
};

const results = await axios.request(options);
```

### Java

```
AsyncHttpClient client = new DefaultAsyncHttpClient();

client.prepare("GET", "https://api.unified.to/unified/integration/saml/5dc620c91e139b20430ad8e0/hubspot?success_redirect=&failure_redirect=&state=&redirect=false&env=Production")
  .setHeader("accept", "application/json")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
```

### Go

```
import (
	"fmt"
	"net/http"
	"io/ioutil"
)

url := `https://api.unified.to/unified/integration/saml/5dc620c91e139b20430ad8e0/hubspot?success_redirect=&failure_redirect=&state=&redirect=false&env=Production

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("accept", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
```

### Python

```
import requests

url = "https://api.unified.to/unified/integration/saml/5dc620c91e139b20430ad8e0/hubspot?success_redirect=&failure_redirect=&state=&redirect=false&env=Production"

headers = {
    "accept": "application/json"
}

response = requests.get(url, headers=headers)
```

### PHP

```
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.unified.to/unified/integration/saml/5dc620c91e139b20430ad8e0/hubspot?success_redirect=&failure_redirect=&state=&redirect=false&env=Production",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "accept: application/json"
  ],
]);
```

### Ruby

```
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.unified.to/unified/integration/saml/5dc620c91e139b20430ad8e0/hubspot?success_redirect=&failure_redirect=&state=&redirect=false&env=Production")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
```

### cURL

```
curl --request GET \
  --url 'https://api.unified.to/unified/integration/saml/5dc620c91e139b20430ad8e0/hubspot?success_redirect=&failure_redirect=&state=&redirect=false&env=Production' \
  --header 'accept: application/json'
```
