NAV
cURL Node.JS Python Java Go

LifeOmic Authentication API v1

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Base URLs:

authentication

saml

Code samples

# You can also use wget
curl -X GET https://api.us.lifeomic.com/v1/saml/metadata

const fetch = require('node-fetch');

fetch('https://api.us.lifeomic.com/v1/saml/metadata',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests

r = requests.get('https://api.us.lifeomic.com/v1/saml/metadata', params={

)

print r.json()

URL obj = new URL("https://api.us.lifeomic.com/v1/saml/metadata");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.us.lifeomic.com/v1/saml/metadata", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /saml/metadata

Fetch SAML service provider metadata.

Fetches the Service Provider SAML metadata for the LifeOmic platform.

Responses

Status Meaning Description Schema
200 OK OK None

authorize

Code samples

# You can also use wget
curl -X GET https://api.us.lifeomic.com/v1/oauth/authorize?response_type=code&client_id=string&redirect_uri=string

const fetch = require('node-fetch');

fetch('https://api.us.lifeomic.com/v1/oauth/authorize?response_type=code&client_id=string&redirect_uri=string',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests

r = requests.get('https://api.us.lifeomic.com/v1/oauth/authorize', params={
  'response_type': 'code',  'client_id': 'string',  'redirect_uri': 'string'
)

print r.json()

URL obj = new URL("https://api.us.lifeomic.com/v1/oauth/authorize?response_type=code&client_id=string&redirect_uri=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.us.lifeomic.com/v1/oauth/authorize", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /oauth/authorize

Sign in a user.

Displays a sign-in view for users. On successful sign-in, the authentication server redirects back to the value specified in the redirect_uri parameter and includes either the requested authorization code or access tokens.

Parameters

Name In Type Required Description
response_type query string true The response type. Must be code or token. Indicates whether the client wants an authorization code (authorization code grant flow) for the end user or directly issues tokens for end user (implicit flow).
client_id query string true The Client ID. Must be a pre-registered client for the PHC.
redirect_uri query string true The URL to which the authentication server redirects the browser after authorization has been granted by the user. Must have been pre-registered with a client.
state query string false An opaque value the clients add to the initial request. The authorization server includes this value when redirecting back to the client.
scope query string false Scopes must be separated by spaces. If the client doesn't request any scopes, the authentication server uses all scopes associated with the client. An ID token is only returned if openid scope is requested. The phone, email, and profile scopes can only be requested if openid scope is also requested. These scopes dictate the claims that go inside the ID token.
code_challenge_method query string false The method used to generate the challenge for PKCE. Currently only S256 is supported.
code_challenge query string false The code challenge for PKCE derived from the code verifier.

Enumerated Values

Parameter Value
response_type code
response_type token
code_challenge_method S256

Responses

Status Meaning Description Schema
302 Found Found None

Response Headers

Status Header Type Format Description
302 Location string The URL that was provided in the redirect_uri parameter. For 'token' responses, the access token will be supplied in the 'access_token' query parameter. For 'code' responses, the authorization code will be supplied in the 'code' query parameter.

token

Code samples

# You can also use wget
curl -X POST https://api.us.lifeomic.com/v1/oauth/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  -H 'Authorization: string'

const fetch = require('node-fetch');
const inputBody = '{
  "grant_type": "authorization_code",
  "client_id": "string",
  "code": "string",
  "redirect_uri": "string",
  "refresh_token": "string",
  "code_verifier": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization':'string'

};

fetch('https://api.us.lifeomic.com/v1/oauth/token',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Accept': 'application/json',
  'Authorization': 'string'
}

r = requests.post('https://api.us.lifeomic.com/v1/oauth/token', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.us.lifeomic.com/v1/oauth/token");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/x-www-form-urlencoded"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"string"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.us.lifeomic.com/v1/oauth/token", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /oauth/token

Get a user's tokens

For the authorization code flow, this allows a client to exchange an authorization code for an access token.

Body parameter

grant_type: authorization_code
client_id: string
code: string
redirect_uri: string
refresh_token: string
code_verifier: string

Parameters

Name In Type Required Description
Authorization header string true If the client was issued a secret, the client must pass its client_id and client_secret in the authorization header through Basic HTTP authorization. The secret is Basic Base64Encode(client_id:client_secret).
body body tokenRequest true none

Example responses

200 Response

{
  "access_token": "string",
  "refresh_token": "string",
  "id_token": "string",
  "token_type": "string",
  "expires_in": 0
}
<?xml version="1.0" encoding="UTF-8" ?>
<tokenResponse>
  <access_token>string</access_token>
  <refresh_token>string</refresh_token>
  <id_token>string</id_token>
  <token_type>string</token_type>
  <expires_in>0</expires_in>
</tokenResponse>

Responses

Status Meaning Description Schema
200 OK none tokenResponse

Schemas

tokenRequest

{
  "grant_type": "authorization_code",
  "client_id": "string",
  "code": "string",
  "redirect_uri": "string",
  "refresh_token": "string",
  "code_verifier": "string"
}

Properties

Name Type Required Restrictions Description
grant_type string true none The grant type.
client_id string true none The client ID. Must be a preregistered client.
code string false none The authorization code. Required if grant_type is authorization_code.
redirect_uri string false none Must be the same redirect_uri that was used to get authorization_code in /oauth/authorize. Required only if grant_type is authorization_code.
refresh_token string false none The refresh token. Required if grant_type is refresh_token.
code_verifier string false none The proof key. Required if grant_type is authorization_code and the authorization code was requested with PKCE.

Enumerated Values

Property Value
grant_type authorization_code
grant_type refresh_token

tokenResponse

{
  "access_token": "string",
  "refresh_token": "string",
  "id_token": "string",
  "token_type": "string",
  "expires_in": 0
}

Properties

Name Type Required Restrictions Description
access_token string false none The access token.
refresh_token string false none The refresh token.
id_token string false none The ID token.
token_type string false none The token type.
expires_in number false none The number of seconds the tokens is valid for.