{
  "info": {
    "_postman_id": "baa5c393-90df-4084-a8e6-c6c6dd2209e0",
    "name": "Postman_collection_PingFed_create_token",
    "description": "This Postman collection contains two calls for testing PingFed setup. \n\n## Setup Environment\nImport `PingFedEnvironmentTemplate.postman_environment.json` into Postman and replace the Placeholders with the proper values for your clients.\n\n## UserInfo\nWith this call the onboarding of a Client to PingFederate can be tested. The expected response is a Object containing the configured claims from the ID token.\n```\n{\n    \"aud\": \"Genestack\",\n    \"sub\": \"gilsdom1\",\n    \"name\": \"Moritz Gilsdorf\",\n    \"groups\": \"Not_Available\",\n    \"given_name\": \"Moritz\",\n    \"family_name\": \"Gilsdorf\",\n    \"email\": \"moritz.gilsdorf@roche.com\"\n}\n```\n \n## Arvados User\nWith this call a production client configuration can be tested to be working with Arvados. \n\n>**Note:** This requires the user correctly onboarded to Arvados.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "12133955"
  },
  "item": [
    {
      "name": "ROPC",
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "username",
              "value": "{{clientId}}",
              "type": "string"
            },
            {
              "key": "password",
              "value": "{{clientSecret}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "grant_type",
              "value": "password",
              "type": "text"
            },
            {
              "key": "username",
              "value": "{{username}}",
              "type": "text"
            },
            {
              "key": "password",
              "value": "{{username}}",
              "type": "text"
            },
            {
              "key": "scope",
              "value": "openid profile",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{iss}}/as/token.oauth2",
          "host": [
            "{{iss}}"
          ],
          "path": [
            "as",
            "token.oauth2"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Device Auth Grant 1",
      "request": {
        "auth": {
          "type": "noauth"
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "scope",
              "value": "openid profile",
              "type": "text"
            },
            {
              "key": "client_id",
              "value": "{{clientId}}",
              "type": "text"
            },
            {
              "key": "client_secret",
              "value": "{{clientSecret}}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{iss}}/as/device_authz.oauth2",
          "host": [
            "{{iss}}"
          ],
          "path": [
            "as",
            "device_authz.oauth2"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Device Auth Grant 2",
      "request": {
        "auth": {
          "type": "noauth"
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "grant_type",
              "value": "urn:ietf:params:oauth:grant-type:device_code",
              "type": "text"
            },
            {
              "key": "client_id",
              "value": "{{clientId}}",
              "type": "text"
            },
            {
              "key": "client_secret",
              "value": "{{clientSecret}}",
              "type": "text"
            },
            {
              "key": "device_code",
              "value": "{{device_code}}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{iss}}/as/token.oauth2",
          "host": [
            "{{iss}}"
          ],
          "path": [
            "as",
            "token.oauth2"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Token Exchange initiated by source client",
      "protocolProfileBehavior": {
        "disabledSystemHeaders": {},
        "strictSSL": true
      },
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "password",
              "value": "{{source_clientSecret}}",
              "type": "string"
            },
            {
              "key": "username",
              "value": "{{source_clientId}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "grant_type",
              "value": "urn:ietf:params:oauth:grant-type:token-exchange",
              "type": "text"
            },
            {
              "key": "subject_token",
              "value": "{{source_token}}",
              "type": "text"
            },
            {
              "key": "subject_token_type",
              "value": "urn:ietf:params:oauth:token-type:jwt",
              "type": "text"
            },
            {
              "key": "scope",
              "value": "openid profile",
              "type": "text"
            },
            {
              "key": "audience",
              "value": "{{target_clientId}}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{iss}}/as/token.oauth2",
          "host": [
            "{{iss}}"
          ],
          "path": [
            "as",
            "token.oauth2"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Token Exchange initiated by target client",
      "protocolProfileBehavior": {
        "disabledSystemHeaders": {},
        "strictSSL": true
      },
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "password",
              "value": "{{target_clientSecret}}",
              "type": "string"
            },
            {
              "key": "username",
              "value": "{{target_clientId}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "grant_type",
              "value": "urn:ietf:params:oauth:grant-type:token-exchange",
              "type": "text"
            },
            {
              "key": "subject_token",
              "value": "{{source_token}}",
              "type": "text"
            },
            {
              "key": "resource",
              "value": "https://predtokenexchange",
              "type": "text"
            },
            {
              "key": "subject_token_type",
              "value": "urn:ietf:params:oauth:token-type:jwt",
              "type": "text"
            },
            {
              "key": "scope",
              "value": "openid profile",
              "type": "text"
            },
            {
              "key": "client_id",
              "value": "{{target_clientId}}",
              "type": "text",
              "disabled": true
            },
            {
              "key": "client_secret",
              "value": "{{target_clientSecret}}",
              "type": "text",
              "disabled": true
            }
          ]
        },
        "url": {
          "raw": "{{iss}}/as/token.oauth2",
          "host": [
            "{{iss}}"
          ],
          "path": [
            "as",
            "token.oauth2"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Token ClientCredentials",
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "username",
              "value": "{{clientId}}",
              "type": "string"
            },
            {
              "key": "password",
              "value": "{{clientSecret}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "urlencoded",
          "urlencoded": [
            {
              "key": "grant_type",
              "value": "client_credentials",
              "type": "text"
            },
            {
              "key": "scope",
              "value": "openid profile",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{iss}}/as/token.oauth2",
          "host": [
            "{{iss}}"
          ],
          "path": [
            "as",
            "token.oauth2"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Refresh",
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "password",
              "value": "{{clientSecret}}",
              "type": "string"
            },
            {
              "key": "username",
              "value": "{{clientId}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "grant_type=refresh_token&refresh_token=CgHorxZZl5yzy4eVr00GWf09kBVD1jE8Sd4qpsLnzE"
        },
        "url": {
          "raw": "{{iss}}/as/token.oauth2",
          "host": [
            "{{iss}}"
          ],
          "path": [
            "as",
            "token.oauth2"
          ],
          "query": [
            {
              "key": "prompt",
              "value": "select_account",
              "disabled": true
            },
            {
              "key": "state",
              "value": "dTj2PDlofr2smSsj2Z1SAGT4p8iSRzDzKZ4AAAwe",
              "disabled": true
            },
            {
              "key": "return_to",
              "value": "{{redirectUri}}",
              "disabled": true
            }
          ]
        }
      },
      "response": []
    },
    {
      "name": "Token creation in Auth tab",
      "request": {
        "auth": {
          "type": "oauth2",
          "oauth2": [
            {
              "key": "grant_type",
              "value": "authorization_code_with_pkce",
              "type": "string"
            },
            {
              "key": "scope",
              "value": "openid profile",
              "type": "string"
            },
            {
              "key": "useBrowser",
              "value": false,
              "type": "boolean"
            },
            {
              "key": "password",
              "value": "{{password}}",
              "type": "string"
            },
            {
              "key": "username",
              "value": "{{username}}",
              "type": "string"
            },
            {
              "key": "clientSecret",
              "value": "{{clientSecret}}",
              "type": "string"
            },
            {
              "key": "clientId",
              "value": "{{clientId}}",
              "type": "string"
            },
            {
              "key": "accessTokenUrl",
              "value": "{{iss}}/as/token.oauth2",
              "type": "string"
            },
            {
              "key": "authUrl",
              "value": "{{iss}}/as/authorization.oauth2",
              "type": "string"
            },
            {
              "key": "redirect_uri",
              "value": "{{redirectUri}}",
              "type": "string"
            },
            {
              "key": "tokenName",
              "value": "{{clientId}}",
              "type": "string"
            },
            {
              "key": "tokenType",
              "value": "Bearer",
              "type": "string"
            },
            {
              "key": "accessToken",
              "value": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImZlZGNlcnQiLCJwaS5hdG0iOiJpZnRnIn0.eyJzY29wZSI6Im9wZW5pZCIsImNsaWVudF9pZCI6InByZWQtZmlzaC1kZXYiLCJpc3MiOiJodHRwczovL3dhbXFhLnJvY2hlLmNvbSIsIm5hbWUiOiJDaHJpc3RpYW4gQmx1bWVucm9laHIiLCJhdWQiOiJwcmVkLWZpc2gtZGV2Iiwic3ViIjoiYmx1bWVucmMiLCJncm91cHMiOlsiR0xPRklTSF9TRF9DVVJBVE9SIiwiR0xPRklTSF9TRF9BRE1JTiIsIkdMT0ZJU0hfQVJTX0FETUlOIiwiR0xPRklTSF9TUlNfQURNSU4iLCJHTE9GSVNIX1BST0pFQ1RfVEVBTSIsIkdMT0ZJU0hfREVWRUxPUEVSUyIsIkdMT0ZJU0hfREEsT1U9QXBwbGljYXRpb25zLE9VPVJvbGVzLE9VPUdyb3VwcyxEQz1lbWVhLERDPXJvY2hlLERDPWNvbSJdLCJlbWFpbCI6ImNocmlzdGlhbi5ibHVtZW5yb2VockByb2NoZS5jb20iLCJleHAiOjE2MjY4NjAxODl9.P0uCeFiAXqQM-EFfBOAjzfPvvRdpqKw5FBnGN7KC24DIigbxMjILsxKcNgLyKQIq4Ceescd-19lcP4YLqtnRlmCyq6QJfc9SbjX5IdbKvvJiVRRe8SwzIA-wfd91O40WQFwiMBg_sqWEsPk1q1mWl24ygbe0PSZGZj5gx6p0g2D_og1F_OLhKmFaB7qXe5O70t4fTsC3OORkDUSiJ7c5THhw5zqyG5H_aKMX4rAjyMCivT8EpwGvo0qO3FNGjBYcgPfOxIBzkiDrmhJPl9EFMbnMoftpkxp7mVwTFYXNL3TRJC24YtY-pgVbNiROYKWozGv9byBYyyBwUJ_2gyI2iw",
              "type": "string"
            },
            {
              "key": "client_authentication",
              "value": "body",
              "type": "string"
            },
            {
              "key": "challengeAlgorithm",
              "value": "S256",
              "type": "string"
            },
            {
              "key": "addTokenTo",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "GET",
        "header": [],
        "url": {
          "raw": "https://see Docs tab",
          "protocol": "https",
          "host": [
            "see Docs tab"
          ]
        }
      },
      "response": []
    }
  ]
}