Get-MsIdAgentIdentityToken
SYNOPSIS
Acquires an access token for an agent identity using client credentials.
SYNTAX
Get-MsIdAgentIdentityToken [[-BlueprintAppId] <String>] [[-AgentIdentityAppId] <String>]
[[-BlueprintSecret] <SecureString>] [[-Scope] <String>] [[-Mode] <String>] [[-UserToken] <String>]
[[-UserUpn] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
To create a new agent identity for this session use Invoke-MsIdAgentIdInteractive.
The token is returned as a SecureString.
EXAMPLES
EXAMPLE 1
$token = Get-AgentIdentityToken -BlueprintAppId "12345..." -AgentIdentityAppId "87654..." -Scope "https://graph.microsoft.com/.default"
EXAMPLE 2
$token = Get-AgentIdentityToken -BlueprintAppId "12345..." -AgentIdentityAppId "87654..." -Scope "https://graph.microsoft.com/.default" -Mode OBO -UserToken $userToken
PARAMETERS
-BlueprintAppId
The blueprint application ID. If not provided, the blueprint created in this session is used.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AgentIdentityAppId
The agent identity application ID. If not provided, the blueprint created in this session is used.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-BlueprintSecret
{{ Fill BlueprintSecret Description }}
Type: SecureString
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Scope
The scope to acquire a token for (e.g., User.Read). If not provided, the default scope is used (https://graph.microsoft.com/.default).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Mode
Authentication mode: AutonomousApp (default), OBO, or AutonomousUser.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: AutonomousApp
Accept pipeline input: False
Accept wildcard characters: False
-UserToken
User token for OBO mode (required when Mode is OBO).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-UserUpn
User UPN for AutonomousUser mode (required when Mode is AutonomousUser).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.