Comments (9)
ran that test "new-oauthtoken" script and it errored out on my win 10 machine, but worked fine on server. i believe this is due to changes in behavior of IE. when launched on win 10 machine it closes and launches new edge.
Also why are you not just using Invoke-RestMethod ?
from pszoom.
The command looks well formatted to me. I tested 2.0.1.0 in PowerShell 5 and 7, and it's working as suspected. I also tried entering wrong credentials and the same error was returned. I suspect it's with how the app was set up or the credentials are not correct.
from pszoom.
I've re-created the app and still getting the same error
ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null.
from pszoom.
I would try making the calls using a plain powershell script or even testing your app with Postman. See https://marketplace.zoom.us/docs/guides/guides/postman/using-postman-to-test-zoom-apis/. The script at the bottom of this comment should return the following when succesful:
New-OAuthToken @params
VERBOSE: POST with 0-byte payload
VERBOSE: received -byte response of content type application/json
VERBOSE: Acquired token.
System.Security.SecureString
or error:
New-OAuthToken @params
VERBOSE: POST with 0-byte payload
VERBOSE: received -byte response of content type application/json
Name Value
---- -----
error invalid_client
reason Invalid client_id or client_secret
VERBOSE: Acquired token.
Here's the script:
function New-OAuthToken {
<#
.SYNOPSIS
Retrieves the Zoom OAuth API token
.PARAMETER ClientID
Client ID of the Zoom App
.PARAMETER ClientSecret
Client Secret of the Zoom App
.PARAMETER AccountID
Account ID of the Zoom App
.OUTPUTS
Zoom API Response
#>
[CmdletBinding()]
param (
[Parameter(valuefrompipeline = $true, mandatory = $true, HelpMessage = "Enter Zoom App Account ID", Position = 0)]
[String]
$AccountID,
[Parameter(valuefrompipeline = $true, mandatory = $true, HelpMessage = "Enter Zoom App Client ID:", Position = 1)]
[String]
$ClientID,
[Parameter(valuefrompipeline = $true, mandatory = $true, HelpMessage = "Enter Zoom App Client Secret:", Position = 2)]
[String]
$ClientSecret
)
$uri = "https://zoom.us/oauth/token?grant_type=account_credentials&account_id={0}" -f $AccountID
#Encoding of the client data
$IDSecret = $ClientID + ":" + $ClientSecret
$EncodedIDSecret = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($IDSecret))
$headers = @{
"Authorization" = "Basic $EncodedIDSecret"
}
try {
$response = Invoke-WebRequest -uri $uri -headers $headers -Method Post -UseBasicParsing
} catch {
ConvertFrom-Json $_.errorDetails -AsHashtable
}
Write-Verbose 'Acquired token.'
$token = ($response.content | ConvertFrom-Json).access_token
$token = ConvertTo-SecureString -String $token -AsPlainText -Force
Write-Output $token
}
$params = @{
AccountID = '1234567891234567890123'
ClientID = '12345678901234567890'
ClientSecret = '12345678901234567890123456789012'
Verbose = $True
}
New-OAuthToken @params
from pszoom.
Ah, this is likely related to internet explorer not being on your local computer. I still have to push those changes to the powershell gallery.
from pszoom.
The changes are pushed to the gallery. Please update your module and try again.
from pszoom.
Hey,
So running that script in Powershell works but just plain running the command Connect-PSZoom -AccountID 'XXXX' -ClientID 'XXXX' -ClientSecret 'XXXX' in powershell doesn't
Annoyingly I'm using Rundeck and not Postman - I'll do some Googling on this one
from pszoom.
Hello @JosephMcEvoy
I'm running into the same issue @AstroFish849 ran into. Were you guys able to find a solution?
from pszoom.
I think this is the issue I'm experiencing at the moment. It's not clear to me why IE is relevant to this issue, could someone please explain?
I've written a little test script that attempts the Connect-PSZoom with the accountid, clientid, and client secret. On my own machine, it works. On the server, it throws the same error messages others have screenshotted.
from pszoom.
Related Issues (20)
- Is there a way to add a manager to a zoom user?
- Error when creating new users: "Invalid URI: The hostname could not be parsed." HOT 3
- Get-ZoomMeetings Error 400 Bad Request HOT 1
- Whatif doesn't prevent action
- 404 Error Removing Users HOT 9
- Get-ZoomUsers -Status All HOT 1
- Where is OAuth on Zoom marketplace HOT 5
- Fix code scanning alert - File 'Connect-PSZoom.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure inf...
- Fix code scanning alert - File 'New-OAuthToken.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure inf... HOT 1
- PSZoom - How to add a manger to a new user?
- Get Sub Account Users HOT 5
- Restart-ZoomRoom 401 error HOT 2
- change the "user type" HOT 1
- Getting Unauthorized error when using Get-ZoomAccountRecordings HOT 1
- zoom call queues HOT 1
- Powershell Gallery is missing new Zoom Phone Functions
- ParticipantVideo parameter not supported by NewMeeting or UpdateMeeting HOT 1
- User accounts not getting created HOT 1
- "Cannot process argument transformation on parameter 'Token'" after updating to 2.0.4.0 HOT 3
- [Query] billing api. Is it possible to query licenses? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pszoom.