AzureUserSecurityContext Class

  • java.lang.Object
    • com.azure.ai.agents.models.AzureUserSecurityContext

Implements

public final class AzureUserSecurityContext
implements JsonSerializable<AzureUserSecurityContext>

User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.

Constructor Summary

Constructor Description
AzureUserSecurityContext()

Creates an instance of AzureUserSecurityContext class.

Method Summary

Modifier and Type Method and Description
static AzureUserSecurityContext fromJson(JsonReader jsonReader)

Reads an instance of AzureUserSecurityContext from the JsonReader.

String getApplicationName()

Get the applicationName property: The name of the application.

String getEndUserId()

Get the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application.

String getEndUserTenantId()

Get the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to.

String getSourceIp()

Get the sourceIp property: Captures the original client's IP address.

AzureUserSecurityContext setApplicationName(String applicationName)

Set the applicationName property: The name of the application.

AzureUserSecurityContext setEndUserId(String endUserId)

Set the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application.

AzureUserSecurityContext setEndUserTenantId(String endUserTenantId)

Set the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to.

AzureUserSecurityContext setSourceIp(String sourceIp)

Set the sourceIp property: Captures the original client's IP address.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

AzureUserSecurityContext

public AzureUserSecurityContext()

Creates an instance of AzureUserSecurityContext class.

Method Details

fromJson

public static AzureUserSecurityContext fromJson(JsonReader jsonReader)

Reads an instance of AzureUserSecurityContext from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of AzureUserSecurityContext if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the AzureUserSecurityContext.

getApplicationName

public String getApplicationName()

Get the applicationName property: The name of the application. Sensitive personal information should not be included in this field.

Returns:

the applicationName value.

getEndUserId

public String getEndUserId()

Get the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.

Returns:

the endUserId value.

getEndUserTenantId

public String getEndUserTenantId()

Get the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant.

Returns:

the endUserTenantId value.

getSourceIp

public String getSourceIp()

Get the sourceIp property: Captures the original client's IP address.

Returns:

the sourceIp value.

setApplicationName

public AzureUserSecurityContext setApplicationName(String applicationName)

Set the applicationName property: The name of the application. Sensitive personal information should not be included in this field.

Parameters:

applicationName - the applicationName value to set.

Returns:

the AzureUserSecurityContext object itself.

setEndUserId

public AzureUserSecurityContext setEndUserId(String endUserId)

Set the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.

Parameters:

endUserId - the endUserId value to set.

Returns:

the AzureUserSecurityContext object itself.

setEndUserTenantId

public AzureUserSecurityContext setEndUserTenantId(String endUserTenantId)

Set the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant.

Parameters:

endUserTenantId - the endUserTenantId value to set.

Returns:

the AzureUserSecurityContext object itself.

setSourceIp

public AzureUserSecurityContext setSourceIp(String sourceIp)

Set the sourceIp property: Captures the original client's IP address.

Parameters:

sourceIp - the sourceIp value to set.

Returns:

the AzureUserSecurityContext object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to