AgentClaims.GetAppId Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| GetAppId(JwtSecurityToken) |
Gets the appid from the given JWT token. This method checks the 'ver' claim to determine whether to look for the appId in the 'appid' claim (for v1 tokens) or the 'azp' claim (for v2 tokens). If the 'ver' claim is not present, it will first attempt to find the appId in the 'appid' claim and if not found, it will look in the 'azp' claim. Returns null if no suitable claim is found. |
| GetAppId(ClaimsIdentity) |
Obsolete.
Retrieves the AppId from the given claims identity. |
GetAppId(JwtSecurityToken)
Gets the appid from the given JWT token. This method checks the 'ver' claim to determine whether to look for the appId in the 'appid' claim (for v1 tokens) or the 'azp' claim (for v2 tokens). If the 'ver' claim is not present, it will first attempt to find the appId in the 'appid' claim and if not found, it will look in the 'azp' claim. Returns null if no suitable claim is found.
public static string GetAppId(System.IdentityModel.Tokens.Jwt.JwtSecurityToken jwtToken);
static member GetAppId : System.IdentityModel.Tokens.Jwt.JwtSecurityToken -> string
Public Function GetAppId (jwtToken As JwtSecurityToken) As String
Parameters
- jwtToken
- JwtSecurityToken
The JWT token to evaluate. Cannot be null.
Returns
The appid or azp value as a string, or null if not found.
Remarks
This is intended for use with tokens issued by the Microsoft identity platform including Azure Bot Token Service.
Applies to
GetAppId(ClaimsIdentity)
Caution
GetAppId is deprecated, please use GetIncomingAudienceClaim instead.
Retrieves the AppId from the given claims identity.
[System.Obsolete("GetAppId is deprecated, please use GetIncomingAudienceClaim instead.")]
public static string GetAppId(System.Security.Claims.ClaimsIdentity claimsIdentity);
[<System.Obsolete("GetAppId is deprecated, please use GetIncomingAudienceClaim instead.")>]
static member GetAppId : System.Security.Claims.ClaimsIdentity -> string
Public Function GetAppId (claimsIdentity As ClaimsIdentity) As String
Parameters
- claimsIdentity
- ClaimsIdentity
The claims identity containing the token information.
Returns
The AppId as a string, or null if not found.
- Attributes
Remarks
For requests from the channel, the AppId is in the Audience claim of the JWT token. For the emulator, it is in the AppId claim. For unauthenticated requests, anonymous claimsIdentity is provided if auth is disabled.