diff --git a/src/microsoftdynamics365/profile.ts b/src/microsoftdynamics365/profile.ts index 08210743..ae920a16 100644 --- a/src/microsoftdynamics365/profile.ts +++ b/src/microsoftdynamics365/profile.ts @@ -95,6 +95,7 @@ export class MicrosoftDynamics365ConnectorProfile extends ConnectorProfileBase { oauth2: { // INFO: when using Refresh Token Grant Flow - access token property is required accessToken: properties.oAuth.accessToken?.unsafeUnwrap() ?? 'dummyAccessToken', + // INFO: when passing only an access token - this value is still required refreshToken: properties.oAuth.flow?.refreshTokenGrant.refreshToken?.unsafeUnwrap() ?? 'dummyRefreshToken', clientId: properties.oAuth.flow?.refreshTokenGrant.clientId?.unsafeUnwrap(), clientSecret: properties.oAuth.flow?.refreshTokenGrant.clientSecret?.unsafeUnwrap(), diff --git a/src/microsoftsharepointonline/profile.ts b/src/microsoftsharepointonline/profile.ts index 0dd3260d..1f5871d4 100644 --- a/src/microsoftsharepointonline/profile.ts +++ b/src/microsoftsharepointonline/profile.ts @@ -91,7 +91,8 @@ export class MicrosoftSharepointOnlineConnectorProfile extends ConnectorProfileB oauth2: { // INFO: when using Refresh Token Grant Flow - access token property is required accessToken: properties.oAuth.accessToken?.unsafeUnwrap() ?? 'dummyAccessToken', - refreshToken: properties.oAuth.flow?.refreshTokenGrant.refreshToken?.unsafeUnwrap(), + // INFO: when passing only an access token - this value is still required + refreshToken: properties.oAuth.flow?.refreshTokenGrant.refreshToken?.unsafeUnwrap() ?? 'dummyRefreshToken', clientId: properties.oAuth.flow?.refreshTokenGrant.clientId?.unsafeUnwrap(), clientSecret: properties.oAuth.flow?.refreshTokenGrant.clientSecret?.unsafeUnwrap(), },