Requirements
- Azure account
API_URLof the Hoop gateway instance
Identity Provider Configuration
Create an Application
Login with your account at https://portal.azure.com/Ensure default delegated permissions:
- Go to Microsoft Entra ID > App Registration.
- Pick a name, and select the Supported account types as you see fit
- Register the application with
{API_URL}/api/callbackas the redirect URI.
We recommend using the option single tenant option for Supported account types. This will allow selecting exactly what groups to propagate to this application. This option is also required to propagate cloud-only groups as names (see more details below).
User.Read for sign in and read user profiles and email to view user’s email address.These attributes are typically created by default. If errors occur, ensure these options are set correctly.
Create the Client Credentials
- Go to App Registration >
{AppName} - In the overview page, copy the Application (client) ID value. This is the Client ID.
- Go to Certificate & Secrets > Client Secrets > New Client Secret
- Copy the Secret Value. This is the Client Secret
Collect Issuer and Custom Scopes Information
The Issuer URL
- Go to App registration >
{AppName}> Overview - Copy the tenant ID and use as the value below
- https://login.microsoftonline.com/{tenant_id}/v2.0
- Use the Client ID to compose the Custom Scopes value
{CLIENT_ID}/.default
Sign in without a client secret
A gateway that runs on Kubernetes can authenticate to Entra ID with a federated credential in place of a client secret. Kubernetes gives the gateway a short-lived service account token, and Entra ID trusts it. There is no secret to expire or rotate.Get the OIDC issuer of the cluster
On AKS, turn on the OIDC issuer and copy its URL:Other clusters need a public OIDC issuer. See Azure Workload Identity: self-managed clusters.
Add a federated credential to the application
Go to App Registration >
{AppName} > Certificates & secrets > Federated credentials > Add credential, select Kubernetes accessing Azure resources, and set:- Cluster issuer URL: the URL from the previous step, exactly as printed, with the final
/. - Namespace: the namespace of the gateway.
- Service account:
hoopgatewayfor the gateway chart. For the control plane chart, its service account:<release>-hoopcontrolplaneby default. - Audience:
api://AzureADTokenExchange.
Mount the token in the gateway
Set these helm values:The chart mounts the token at
/var/run/secrets/hoop/idp/token. Kubernetes renews it, and the gateway reads it again on each request to Entra ID, so no restart is needed.Configure the provider
In the Web App, go to Integrations > Authentication. In the OIDC form, select Federated token under Client Authentication and keep the path The gateway refuses a client secret and a token file together.
/var/run/secrets/hoop/idp/token. The gateway accepts only the path in IDP_CLIENT_ASSERTION_FILE, which idpFederatedToken.enabled sets. Fill the Client ID, the Issuer URL and the Custom Scopes as in the steps above.With the deprecated IDP_* variables, set them without IDP_CLIENT_SECRET. idpFederatedToken.enabled sets IDP_CLIENT_ASSERTION_FILE for you.Configuring Groups Claims
The integration relies on groups propagated in theid_token. By default, Azure Entra ID propagates them in the groups claims.
The gateway needs to be configured to match the claim name of the groups.
This configuration will ensure to sync the groups when a user authenticates on Hoop.
By default the gateway uses the claim name
groups.
To change it, go to Integrations > Authentication and include a distinct group.Propagating Groups as Names
It’s possible to propagate groups with their display names for cloud groups.- Click on Manifest
- Edit the item groups under optionalClaims.idToken and optionalClaims.accessToken attributes and add the name cloud_displayname
- Make sure that groupMembershipClaims is set to ApplicationGroup
- Click on Save
For other kind of groups it’s possible to append additional
properties as sam_account_name, dns_domain_and_sam_account_name or netbios_domain_and_sam_account_name.Assign Groups to Application
- Go to Enterprise Application >
{AppName}> User and Groups > Add user/group - Select the desired groups and click on Select
- Click on Assign
This option requires an AD subscription that allows assigning groups to application.
Machine to Machine Access (M2M)
It is possible to access hoop by issuing access tokens using the Oauth2 Client Credentials Flow. The gateway validates and authenticates any access token generated by the app registered in Azure, provided that a service account is active on hoop. The only requirement is that the service account has the same Object ID as the application, which serves as its main identifier.Authentication only occurs when a token is issued by the identity provider. The service account resource simply maps the subject to identify who is accessing the API.
Creating a Service Account
To obtain the Object ID of the application navigate to: Azure Portal > Microsoft Entra ID > Enterprise Applications
Creating an Access Token
- Go to App Registrations > Certificate & Secrets > New Client Secret
<APP_CLIENT_SECRET>
- Generate an access token
- APP_CLIENT_ID: the client id of the application
- APP_CLIENT_SECRET: the client secret generated in the step 1
- TENANT_ID: the tenant id of you app instance
In case of receiving access denied (401), make sure that the subject of the access token matches the subject provided when creating the service account (usually matches the object id of the application)