Using PhenixID HTTP API for ticket translation oAuth2 Bearer token - SAML2 (eHM SAML Token use case)

Overview

To use the API, one method is called. It will return:

- HTTP Status code 200 if oAuth2 access_token is still valid. SAMLResponse (base64 encoded) will be returned

- HTTP Status code 403 if oAuth2 access_token is not valid.  

Prerequisites

- PhenixID Authentication Services HTTP API configured for oAuth2-SAML2 ticket translation use case

ehmSamlToken - data to be fetched before api call

The api client must fetch this value:

- access_token, returned from previous authentication (this might be returned through API, OIDC or "ordinary" SAML2)

 How this parameter is fetched may differ depending on the use case.

ehmSamlToken - api call

Request

Method: HTTP PUT

Endpoint: /api/authentication/ehmSAMLToken

Headers:

Name Value
Mandatory Comment
Content-Type application/json Yes
tenant t1 Yes .Value must be given to you by PhenixID Signing Service admin, it might differ depending on the environment.
Authorization Bearer <access_token> Yes <access_token> should be replaced with the access_token fetched previously.

Body:

No body content.

Example request

 

PUT /api/authentication/ehmSAMLToken HTTP/1.1
Host: integration.phenixid.se
tenant: t1
Content-Type: application/json
Authorization: Bearer f4974cb0-837b-44ff-aa43-e70187ab0663
cache-control: no-cache

Response

Response

The HTTP Response status code may have one of these values:

1. 200. oAuth2 bearer token is valid. Body will contain SAMLResponse.

2. 403. oAuth2 bearer token is not valid - user must re-authenticate.

 

The response body JSON structure properties: 

Name Comment
SAMLResponse
The entire SAML Response, base64 encoded.

Example response:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 390010
{
    "SAMLResponse": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJwOlJlc3BvbnNlIHhtbG5zOnNhbWwycD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIERlc3RpbmF0aW9uPSJodHRwczovL3d3dzYuYXBvdGVrZXQuc2UvYXV0aGVudGljYXRlL3ZhbGlkYXRlZWxlZ2xvZ2luIiBJRD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