diff --git a/backend/src/ee/services/secret-rotation-v2/azure-client-secret/azure-client-secret-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/azure-client-secret/azure-client-secret-rotation-fns.ts index 039033fe6..ea24c669d 100644 --- a/backend/src/ee/services/secret-rotation-v2/azure-client-secret/azure-client-secret-rotation-fns.ts +++ b/backend/src/ee/services/secret-rotation-v2/azure-client-secret/azure-client-secret-rotation-fns.ts @@ -153,12 +153,8 @@ export const azureClientSecretRotationFactory: TRotationFactory< * Maps the generated credentials into the secret payload format. */ const getSecretsPayload: TRotationFactoryGetSecretsPayload = ({ - clientSecret, - clientId - }) => [ - { key: secretsMapping.clientSecret, value: clientSecret }, - { key: secretsMapping.clientId, value: clientId } - ]; + clientSecret + }) => [{ key: secretsMapping.clientSecret, value: clientSecret }]; return { issueCredentials, diff --git a/backend/src/services/app-connection/azure-client-secrets/azure-client-secrets-connection-fns.ts b/backend/src/services/app-connection/azure-client-secrets/azure-client-secrets-connection-fns.ts index 830cbbec3..463e40e7c 100644 --- a/backend/src/services/app-connection/azure-client-secrets/azure-client-secrets-connection-fns.ts +++ b/backend/src/services/app-connection/azure-client-secrets/azure-client-secrets-connection-fns.ts @@ -31,8 +31,6 @@ export const getAzureClientSecretsConnectionListItem = () => { }; }; -const EXPIRATION_TIME = 300000; - export const getAzureConnectionAccessToken = async ( connectionId: string, appConnectionDAL: Pick, @@ -63,14 +61,9 @@ export const getAzureConnectionAccessToken = async ( encryptedCredentials: appConnection.encryptedCredentials })) as TAzureClientSecretsConnectionCredentials; - const { expiresAt, refreshToken } = credentials; + const { refreshToken } = credentials; const currentTime = Date.now(); - // get new token if expired or less than 5 minutes until expiry - if (currentTime < expiresAt - EXPIRATION_TIME) { - return credentials.accessToken; - } - const { data } = await request.post( IntegrationUrls.AZURE_TOKEN_URL.replace("common", credentials.tenantId || "common"), new URLSearchParams({ diff --git a/docs/integrations/app-connections/azure-client-secrets.mdx b/docs/integrations/app-connections/azure-client-secrets.mdx index dd91205f5..55416303a 100644 --- a/docs/integrations/app-connections/azure-client-secrets.mdx +++ b/docs/integrations/app-connections/azure-client-secrets.mdx @@ -36,13 +36,19 @@ Infisical currently only supports one method for connecting to Azure, which is O #### Azure Client Secrets permissions - Set the API permissions of the Azure application to include the following Azure Client Secrets permissions: + Set the API permissions of the Azure application to include the following permissions: - Microsoft Graph - `Application.ReadWrite.All` + - `Application.ReadWrite.OwnedBy` + - `Application.ReadWrite.All` (Delegated) + - `Directory.ReadWrite.All` (Delegated) + - `User.Read` (Delegated) - Azure App Configuration - - `KeyValue.Delete` - - `KeyValue.Read` - - `KeyValue.Write` + - `KeyValue.Delete` (Delegated) + - `KeyValue.Read` (Delegated) + - `KeyValue.Write` (Delegated) + - Access Key Vault + - `user_impersonation` (Delegated) ![Azure client secrets](/images/integrations/azure-client-secrets/app-api-permissions.png) diff --git a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewAzureClientSecretRotationGeneratedCredentials.tsx b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewAzureClientSecretRotationGeneratedCredentials.tsx index 7dd94b6c5..4e6aeeed1 100644 --- a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewAzureClientSecretRotationGeneratedCredentials.tsx +++ b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewAzureClientSecretRotationGeneratedCredentials.tsx @@ -19,7 +19,7 @@ export const ViewAzureClientSecretRotationGeneratedCredentials = ({ - {activeCredentials?.clientId} + {activeCredentials?.clientId} {activeCredentials?.clientSecret} @@ -27,7 +27,7 @@ export const ViewAzureClientSecretRotationGeneratedCredentials = ({ } inactiveCredentials={ <> - {inactiveCredentials?.clientId} + {inactiveCredentials?.clientId} {inactiveCredentials?.clientSecret} diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AzureClientSecretRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AzureClientSecretRotationParametersFields.tsx index 982e2a392..6b7ca957e 100644 --- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AzureClientSecretRotationParametersFields.tsx +++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AzureClientSecretRotationParametersFields.tsx @@ -38,8 +38,11 @@ export const AzureClientSecretRotationParametersFields = () => { content={ <> Ensure that your connection has the{" "} - Application.ReadWrite.All permission and - the application exists in Azure. + + Application.ReadWrite.All, Directory.ReadWrite.All, + Application.ReadWrite.OwnedBy, user_impersonation and User.Read + {" "} + permissions and the application exists in Azure. } > diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/AzureClientSecretRotationSecretsMappingFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/AzureClientSecretRotationSecretsMappingFields.tsx index 77a34d083..7c99e0687 100644 --- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/AzureClientSecretRotationSecretsMappingFields.tsx +++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/AzureClientSecretRotationSecretsMappingFields.tsx @@ -16,24 +16,6 @@ export const AzureClientSecretRotationSecretsMappingFields = () => { const { rotationOption } = useSecretRotationV2Option(SecretRotation.AzureClientSecret); const items = [ - { - name: "Client ID", - input: ( - ( - - - - )} - control={control} - name="secretsMapping.clientId" - /> - ) - }, { name: "Client Secret", input: (