-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New-RubrikAPIToken returns Invoke-WebRequest : Request needs authentication! #824
Comments
.EXAMPLE What authority or role is needed for New-RubrikAPIToken? |
We see the same issue here.
Then use Get-RubrikUser to fetch my User_ID
|
I'm attempting to use a Service Account (with Administrator Role), and have the same problem/error message. It is unlikely an authority issue. |
Any work around for this issue? |
I have ran into the same issue. I have tried passing creds several different ways. If you make the call manually using the api address and passing creds it will return the key. However, if you're using this powershell command it has the error.
|
Current Behavior:
When using Connect-Rubrik and Toekn to conenct to Rubrik cluster and trying to create new Token in same session,
The command New-RubrikAPIToken fails and returns "Invoke-WebRequest : Request needs authentication!"
Provide information about the failure by issuing the command using the
-Verbose
command. Ensure that any identifiable information (server names, tokens, passwords) is removed from your logs before sharing this on GitHub.New-RubrikAPIToken -Tag "TestToken-01" -Expiration 100 -Verbose
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for New-RubrikAPIToken
VERBOSE: Selected 5.0 API Data for New-RubrikAPIToken
VERBOSE: Load API data for New-RubrikAPIToken
VERBOSE: Description: Create an API Token
VERBOSE: Build the URI
VERBOSE: URI = https://rubrikcluster.mydomain.com/api/internal/session
VERBOSE: Build the query parameters for
VERBOSE: URI = https://rubrikcluster.mydomain.com/api/internal/session
VERBOSE: Body = {
"initParams": {
"apiToken": {
"tag": "TestToken-01",
"expiration": 100
}
}
}
VERBOSE: Submitting the request
VERBOSE: Submitting "Post" request as "text/plain; charset=utf-8"
VERBOSE: Invoking request with a custom timeout of 100 seconds
VERBOSE: POST https://rubrikcluster.mydomain.com/api/internal/session with -1-byte payload
Invoke-WebRequest : Request needs authentication!
At C:\Users\UserName\Documents\WindowsPowerShell\Modules\Rubrik\Private\Invoke-RubrikWebRequest.ps1:36 char:23
Expected Behavior:
New-RubrikAPIToken uses curernt Token as authentication and don't requests authenticatino again.
Steps to Reproduce:
Please provide detailed steps for reproducing the issue.
Context:
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Get-Module -ListAvailable Rubrik
$PSVersiontable.PSVersion
$PSVersiontable.PSVersion
on PowerShell 6 and later, use(Get-WMIObject win32_operatingsystem).Name
for Windows PowerShellFailure Logs
Please include any relevant log snippets or files here, IMPORTANT all information will be visible publicly on GitHub. Do not include computer or user names, passwords, API tokens or any identifiable information when submitting failure logs.
The text was updated successfully, but these errors were encountered: