Description
Whenever involving any ExchangeOnline provider capability, I get the error
Exception calling "EnsureMailboxType" with "3" argument(s): "Exception calling "GetMailbox" with "2" argument(s): "Exception
calling "GetMailbox" with "2" argument(s): "Exception calling "InvokeSafely" with "2" argument(s): "The variable
'$bearerTokenPattern' cannot be retrieved because it has not been set.""""
Steps to Reproduce
- Create any ExchangeOnline Workflow step
- Create AuthSession with Scopes
$scopes = @(
'User.ReadWrite.All'
'Group.Read.All'
'GroupMember.ReadWrite.All'
'MailboxSettings.ReadWrite'
)
and
$entraToken = Get-MsalToken -TenantId $tenantId -ClientId $clientId -Scopes $scopes -DeviceCode`
$entraAccessToken = $entraToken.AccessToken
and using this accesstoken for Idle-AuthSessionBroker setup.
Expected Behavior
Authentication with token provided.
Actual Behavior
It brings the error.
Environment
- PowerShell version: 7.5.4
- OS: Windows Server 2019
- IdLE version / commit: main
Additional Context
- Same procedure works with Entra Provider, so assuming something provider specific. Maybe to adopt the authentication methods from AD Provider?
- I was using the same
$entraAccessToken variable for both provider AuthSessions:
$authSessions = New-IdleAuthSession -SessionMap @{
@{ AuthSessionName = 'AD' } = @{ AuthSessionType = 'Credential'; Credential = $adCred }
@{ AuthSessionName = 'Entra' } = @{ AuthSessionType = 'OAuth'; Credential = $entraAccessToken }
@{ AuthSessionName = 'EXO' } = @{ AuthSessionType = 'OAuth'; Credential = $entraAccessToken }
}
$providerAD = New-IdleADIdentityProvider
$providerEntra = New-IdleEntraIDIdentityProvider
$providerEXO = New-IdleExchangeOnlineProvider
$providers = @{
AD = $providerAD
Entra = $providerEntra
EXO = $providerEXO
AuthSessionBroker = $authSessions
}
But also duplicating the tokens to a separate $entraAccessToken and $exoAccessToken does not change the behavior.
Description
Whenever involving any ExchangeOnline provider capability, I get the error
Steps to Reproduce
and
and using this accesstoken for Idle-AuthSessionBroker setup.
Expected Behavior
Authentication with token provided.
Actual Behavior
It brings the error.
Environment
Additional Context
$entraAccessTokenvariable for both provider AuthSessions:But also duplicating the tokens to a separate $entraAccessToken and $exoAccessToken does not change the behavior.