Skip to content

Retrieves stored user data in Azure Active Directory

Element Name: Retrieves stored user data in Azure Active Directory

Category: Active Directory

Description: Advanced functionality that manages user data requests to Azure AD.

Functionality: Retrieves stored user data from Azure Active Directory.

Action Configuration Fields

[Object Identifier in Azure Active Directory]: Identifier of the client in Azure Active Directory. This field is a unique identifier used to identify a user in Azure Active Directory. For example "93f06bf1-4408-4b29-9737-c5e94dfsasf7a1".

Definitionn:📚 Azure Active Directory is a cloud-based directory service that allows organizations to manage access and identity for their users and resources in the cloud and on their on-premises networks. Each user that registers in Azure Active Directory receives a unique identifier called "Object ID," which is an alphanumeric value that uniquely identifies that user within the directory. This identifier can be used in various operations, such as assigning permissions and performing queries and searches in the directory. In summary, the Object ID is a key element for managing and administering users in Azure Active Directory.

[Tenant Identifier in Azure Active Directory]: The tenant identifier in Azure Active Directory (Azure AD) is a unique alphanumeric value that uniquely identifies the Azure AD instance to which an organization belongs. The term "tenant" refers to an Azure AD instance that represents the organization and its users, groups, and resources in the Azure AD directory.

[Client Identifier in Azure Active Directory]: The client identifier in Azure Active Directory (Azure AD) is a unique value used to uniquely identify an application or service that interacts with Azure AD. This identifier is used to authorize and authenticate the application or service in Azure AD, and to register and track its interactions and transactions in the directory.

[Azure Active Directory Client Secret]: The Client Secret in Azure Active Directory (Azure AD) is a value used as a method of authentication and authorization for applications that integrate with Azure AD. The secret key is a randomly generated string of characters used to identify and authenticate an application or service in Azure AD.

[Graph API Version]: Active Directory data is retrieved using an API with the graph.microsoft.com platform, and this field should specify the version of the graph.microsoft API.

If VERSION_API_GRAPH = beta is used, the result of the component will be similar to the one shown below:

[Output Entity]: Entity where a JSON with user information retrieved from Active Directory is returned, it is important to note that the user's email is in the 'email' property of the JSON.

Response JSON Structure:

    {
        "@odata.context": "https://graph.microsoft.com/beta/$metadata#users/$entity",
        "id": "93f06bf1-4408-4b29-7777-c5e94dfsasf7a1",
        "deletedDateTime": null,
        "accountEnabled": true,
        "ageGroup": null,
        "businessPhones": [],
        "city": null,
        "createdDateTime": "2020-03-23T18:30:13Z",
        "creationType": null,
        "companyName": null,
        "consentProvidedForMinor": null,
        "country": null,
        "department": null,
        "displayName": "demo",
        "employeeId": null,
        "employeeHireDate": null,
        "employeeType": null,
        "faxNumber": null,
        "givenName": "demo",
        "imAddresses": [],
        "infoCatalogs": [],
        "isManagementRestricted": null,
        "isResourceAccount": null,
        "jobTitle": null,
        "legalAgeGroupClassification": null,
        "mail": null,
        "mailNickname": "demo",
        "mobilePhone": null,
        "onPremisesDistinguishedName": "CN=demo,OU=\_E-contact,DC=e-contact,DC=cl",
        "officeLocation": null,
        "onPremisesDomainName": "e-contact.cl",
        "onPremisesImmutableId": "c5GyVfddsfkGs/o3dd3anuM6g==",
        "onPremisesLastSyncDateTime": "2020-12-10T16:24:27Z",
        "onPremisesSecurityIdentifier": "S-1-5-21-842925246-688744444-839522115-dfasdf23",
        "onPremisesSamAccountName": "demo",
        "onPremisesSyncEnabled": true,
        "onPremisesUserPrincipalName": "demo@e-contact.cl",
        "otherMails": [],
        "passwordPolicies": "DisablePasswordExpiration",
        "postalCode": null,
        "preferredDataLocation": null,
        "preferredLanguage": null,
        "proxyAddresses": [],
        "refreshTokensValidFromDateTime": "2020-03-23T18:08:13Z",
        "showInAddressList": null,
        "signInSessionsValidFromDateTime": "2020-03-23T18:08:13Z",
        "state": null,
        "streetAddress": null,
        "surname": null,
        "usageLocation": null,
        "userPrincipalName": "demo@e-contact.cl",
        "externalUserState": null,
        "externalUserStateChangeDateTime": null,
        "userType": "Member",
        "employeeOrgData": null,
        "passwordProfile": null,
        "assignedLicenses": [],
        "assignedPlans": [],
        "deviceKeys": [],
        "identities": 
        [
            {
                "signInType": "userPrincipalName",
                "issuer": "econtactcl.onmicrosoft.com",
                "issuerAssignedId": "demo@e-contact.cl"
            }
        ],
        "onPremisesExtensionAttributes": 
        {
            "extensionAttribute1": null,
            "extensionAttribute2": null,
            "extensionAttribute3": null,
            "extensionAttribute4": null,
            "extensionAttribute5": null,
            "extensionAttribute6": null,
            "extensionAttribute7": null,
            "extensionAttribute8": null,
            "extensionAttribute9": null,
            "extensionAttribute10": null,
            "extensionAttribute11": null,
            "extensionAttribute12": null,
            "extensionAttribute13": null,
            "extensionAttribute14": null,
            "extensionAttribute15": null
        },
        "onPremisesProvisioningErrors": [],
        "provisionedPlans": [],
        "email": "demo@e-contact.cl"
    }

[Error Handler]: Action to execute in case of an error. The action flow will be interrupted and the error description will be passed to the selected intent with the name: 'AzureAD_email_Error'.

Implementation Example

Preconditions:

Entity: IdUserAD (Type String), this value can be retrieved from the Teams channel, when a user converses through Teams, the user's identifier can be retrieved from Active Directory.

System Entity: @ClientName <- Luis Arévalo

Error handling intent: ErrorHandler

--Input

[Object identifier in Azure Active Directory]: IdUserAD

[Tenant identifier in Azure Active Directory: AzureAD_CLIENT_ID]: d4914415-cccc-499e-9407-c7a41b14bc80

[Client Secret (Client Secret) of Azure Active Directory]: ‘8461cc23-cccc-42f0-b963-44444374eea4’

[Microsoft Graph API version]: ‘v1.0’

[Entity that returns a JSON with user information]: @OUTPUT_RESULT_ENTITY

[Error Handler]: ErrorHandler

Returns the data stored in Azure Active Directory based on the user's Identifier.

The result of this query is a JSON with the following format:

{ 
    "@odata.id": "https://graph.microsoft.com/v2/b5fc69f5-cda9-4db2-bd83-8bd9d99bb819/directoryObjects/7ec6551d-5267-4b5e-a6d0-c632237def3ab/Microsoft.DirectoryServices.User",
    "businessPhones": [], 
    "displayName": "Pedro Perez", 
    "givenName": "Pedro", "jobTitle": null, 
    "mail": null, 
    "mobilePhone": null,
    "officeLocation": null,
    "preferredLanguage": null,
    "surname": "Perz", 
    "userPrincipalName": "demo@e-contact.cl", 
    "id": "3245478-5267-4b5e-a6d0-c69167def3ab", 
    "email":"demo@e-contact.cl " 
}

In case the user's identifier is not found or if the email is null, the following JSON is returned:

{
    "email":”EmailNotFound”
}

This process returns the email in the entity specified in the parameter OUTPUT_RESULT_ENTITY, in case the object ID is not in Active Directory or the email is empty or has the wrong format, the text EmailNotFound is returned.