PingOne Platform APIs

Step 4: Call the SAML resume endpoint

GET {{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}

This example shows the GET /{{envID}}/saml20/resume?flowId={{flowID}} operation to return the flow back to the authorization service to continue processing after the completion of the SAML authentication flow.

The request URL includes the query parameter ?flowId={{flowID}} to pass in the current flow ID (also specified in the previous step).

The response returns a 200 Success message, and the response data includes an encoded SAMLResponse.

Example Request

  • cURL

  • C#

  • Go

  • HTTP

  • Java

  • jQuery

  • NodeJS

  • Python

  • PHP

  • Ruby

  • Swift

curl --location --globoff '{{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}'
var options = new RestClientOptions("{{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main

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

func main() {

  url := "{{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
GET /{{envID}}/saml20/resume?flowId={{flowID}} HTTP/1.1
Host: {{authPath}}
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("{{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}")
  .method("GET", body)
  .build();
Response response = client.newCall(request).execute();
var settings = {
  "url": "{{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}",
  "method": "GET",
  "timeout": 0,
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var request = require('request');
var options = {
  'method': 'GET',
  'url': '{{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}',
  'headers': {
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "{{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}"

payload = {}
headers = {

}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(

));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
require "uri"
require "net/http"

url = URI("{{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var request = URLRequest(url: URL(string: "{{authPath}}/{{envID}}/saml20/resume?flowId={{flowID}}")!,timeoutInterval: Double.infinity)
request.httpMethod = "GET"

let task = URLSession.shared.dataTask(with: request) { data, response, error in
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()

Example Response

200 OK

<!-- template name: saml20.response.autopost.ftl -->
<html>
    <head>
        <title>Submit Form</title>
    </head>
    <body onload="javascript:document.forms[0].submit()">
        <noscript>
            <p>
                <strong>Note:</strong> Since your browser does not support JavaScript,
                        you must press the Resume button once to proceed.
            </p>
        </noscript>
        <form method="post" action="https://example.com">
            <input type="hidden" id="SAMLResponse" name="SAMLResponse" value="PHNhbWxwOlJlc3BvbnNlIElEPSJpZC1jYjgwYjk4ZS1iMTM5LTRlYzctYWM5Mi1jOTRkMDk4MWQ3NjQiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDI2LTA0LTIyVDE0OjQ4OjQxLjQxNloiIEluUmVzcG9uc2VUbz0iSUQtOGExZjA2YTMtZjQ3ZS00NzdiLWJhYzQtMzE4NjZhOWZiMTAxIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9leGFtcGxlLmNvbSIgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCI+PHNhbWw6SXNzdWVyIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iPmh0dHBzOi8vYXV0aC5waW5nb25lLmNvbS8yYjI0NzdmZC1lNzc4LTRmNDctYjc0ZS05OTJjNzQ5ZTllZTY8L3NhbWw6SXNzdWVyPjxzYW1scDpTdGF0dXM+PHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdGF0dXM6UmVzcG9uZGVyIj48c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpSZXF1ZXN0RGVuaWVkIi8+PC9zYW1scDpTdGF0dXNDb2RlPjxzYW1scDpTdGF0dXNNZXNzYWdlPlVzZXIgZG9lcyBub3QgaGF2ZSBhcHByb3ByaWF0ZSBncm91cCBtZW1iZXJzaGlwczwvc2FtbHA6U3RhdHVzTWVzc2FnZT48L3NhbWxwOlN0YXR1cz48L3NhbWxwOlJlc3BvbnNlPg=="/>
            <input type="hidden" id="RelayState" name="RelayState" value="token"/>
            <noscript>
                <input type="submit" value="Resume"/>
            </noscript>
        </form>
    </body>
</html>