Authentication Tutorial

Basic Auth

The simplest way to interact with Aidbox API from your confidential (backend) code is a Basic Auth

To start you have to register in Aidbox Auth Client with secret and basic flow enabled in this form:

Auth Client form (1).png>)

PUT Client/basic (1).png>)

Let's create AccessPolicy for this Client

PUT AcessPolicy/basic-policy.png>)

GET /Patient (1).png>)

Client Credentials Flow

Client get access by OAuth 2.0 Client Credentials flow

To start you have to register in Aidbox OAuth Client with secret and client\_credentials flow enabled

OAuth Client form.png>)

Before you start - create a Client

.png>)

And policy for this client

.png>)

.png>)

When you have a token!

.png>)

Now using this access token we can query Aidbox

.png>)

Resource Owner Flow

This flow works for mobile and desktop apps.

Before you start - create a Client and User

.png>)

.png>)

.png>)

When you have a token!

.png>)

Now using this access token we can query Aidbox

.png>)

Authorization Code Flown

This flow works for web and single page apps

Before you start - create a Client and User

.png>)

.png>)

Now we have to go to authorize endpoint to get code

/auth/authorize?client_id=web-app&response_type=code

.png>)

When you have a token!

.png>)

Now using this access token we can query Aidbox

.png>)

Implicit Flow

This flow works for single page apps. Before you start - create a Client

.png>)

Now we have to go to authorize endpoint to get code

/auth/authorize?client_id=web-app&response_type=code

When you have a token!

.png>)

Now using this access token we can query Aidbox

.png>)

JWT Auth

If you use external server, which provides you with JWT access token - you can configure Aidbox to trust this JWT token and act as Resource Server

_You can use for example this_ _app to generate test JWT_\_\_

First of all you have to register TokenIntrospector in Aidbox

.png>)

.png>)

SMART on FHIR Flow

.png>)

When you have a token!

.png>)

Now using this access token we can query Aidbox

.png>)