Skip to main content

Getting Started

Authentication

As mentioned in the Getting Started Overview we provide two technology assets, Now let's delve deeper into the authentication.

We Suggest to Integrate our Apis with the Partner Backend, This can be achived using the following Authentication.

REST Api Authentication

We use Microsoft Identity Platform to retrieve the JWT using the OAuth2 protocol.

So you can retrieve the Token calling the follow Api REST:

curl --location 'https://login.microsoftonline.com/FLOWE_AZURE_TENANT/oauth2/v2.0/token' \
--form 'client_id="PARTNER_CLIENT_ID"' \
--form 'client_secret="PARTNER_CLIENT_SECRET"' \
--form 'scope="api://p1-FLOWE_TIER/.default"' \
--form 'grant_type="client_credentials"'

Further information at Microsoft Identity Platform Docs

The Token retrieved will contain all the permissions assigned to the Partner. Now the Partner can call our Apis using the token in a Bearer Authentication like following:

curl --location 'https://FLOWE_PREFIX_DNS_ENVIRONMENT.flowe.com/FLOWE_API_ROUTE' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer JWT_TOKEN' \
--header 'AuthKey: PARTNER_AUTHKEY' \
--header 'Partner: PARTNER_NAME'

Message Broker Authentication

Using the same parameters (FLOWE_AZURE_TENANT, PARTNER_CLIENT_ID and the PARTNER_CLIENT_SECRET) you can get token and access to the Our Public Message Broker in which you will get Our Asynchronous Events.

Following an Example of C# Code

using Azure.Identity;
using Azure.Messaging.ServiceBus;

TokenCredential credential = new ClientSecretCredential(
FLOWE_AZURE_TENANT,
PARTNER_CLIENT_ID,
PARTNER_CLIENT_SECRET);

var client = new ServiceBusClient(
"FLOWE_PUBLIC_SERVICE_BUS.servicebus.windows.net",
credential,
options);

Once you have the ServiceBusClient instance you can Process Messages targeting topic PARTNER_NAME and subscription PARTNER_NAME.

Parameters to Access to the Environment (Sandbox/Test)

Contact Flowe to receive the following parameters:

PlaceholderDescriptionProvided by Flowe Admin
FLOWE_AZURE_TENANTFlowe Azure Tenant Id
PARTNER_CLIENT_IDPartner Client Id to get the Token
PARTNER_CLIENT_SECRETPartner Client Secret to get the Token
FLOWE_TIERFlowe Tier in which you are operating
FLOWE_PREFIX_DNS_ENVIRONMENTFlowe Prefix DNS based on the Tier
FLOWE_API_ROUTEFlowe Api Route, Read it in Api Docs
JWT_TOKENJWT Token Retrieved in the Auth Api Rest
PARTNER_AUTHKEYPartner Authentication Key
PARTNER_NAMEPartner Name
FLOWE_PUBLIC_SERVICE_BUSFlowe Public Service Bus Namespace Endpoint