DAL Authentication
The DAL requires multiple things to be provided to successfully return a response.
Please note the DAL on the CDP dev environment has auth disabled so will return a response to all requests
Required for all requests
- If making a request from a DEFRA environment, you will need to either be within the CDP network or request your IP to be whitelisted.
NOTE: the CDP
ext-testandprodenvironments are externally accessible. - You will need a valid Entra token containing a group that has already been provided and mapped to the corresponding access in the DAL. This POST request shows how to get a token:
curl --location 'https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token' \ --form 'client_id="{client_id}"' \ --form 'scope="{client_id}/.default"' \ --form 'client_secret="{client_secret}"' \ --form 'grant_type="client_credentials"'
Internal User requests
- The email address of the user making the request, sent in the
emailheader. NOTE: This email must match an account on the RP portal (with the correct permissions)
External User requests
- Set
x-forwarded-authorizationheader to a Defra ID token that contains the relevant CRN and SBI (if requesting business data)
Service Account requests
The internal and external routes above require a user to be accessing the system. If a client needs to make a DAL call when there is no user initiating the request (for example a batch), then a service account may be used. Please refer to the Service Account documentation for more information.
- The email address of the service account should be added to the
service-accountheader.