Hello! I’ve update Nexus to version 3.17.0 and also have a powershell-script that communicates via nexus-api and upload java packages to repository. In nearest time we are planing to migrate our java-packages to Nexus.
This script was worked fine until latest update and now when I try to use it I’ve got this error: Response: [403] (no entity/body); mapped from: org.apache.shiro.authz.UnauthorizedException: Anti cross-site request forgery token mismatch
Password is correct (triple check that)
Using 6.0 version of PowerShell
Error message from server log: 2019-06-28 09:12:57,694+0000 WARN [qtp805360496-2091] ado org.sonatype.nexus.siesta.internal.AuthorizationExceptionMapper - (ID 25c2f7c3-d764-41a2-a5b3-042e833e6727) Response: [403] (no entity/body); mapped from: org.apache.shiro.authz.UnauthorizedException: Anti cross-site request forgery token mismatch
Script:
Could you doublecheck that the server you’re accessing is 3.17 not 3.16.2 or earlier? We included a fix for this issue with PowerShell so I’m surprised to hear that you’re still experiencing the problem.
Hello mpiggott!
Yes, I’m sure about 3.17.0-01 version. Screenshots in the attach.
But in the ticket you provide another cmdlet was used - Invoke-WebRequest. (Invoke-WebRequest)
I’m using Invoke-RestMethod instead. (Invoke-RestMethod)
For more info:
Host: CentOS 7.6
Nexus 3.17.0 in docker image.
As a suggestion: may be provide in code just “PowerShell”? It will be sufficient for WindowsPowerShell and for newer version of PowerShell. (after version 6 it’s become just “PowerShell”)
Hi,
Could you recheck if the user you are trying to upload from has the correct permissions?
nx-component-upload was one of the permission/privilege missing for my user.
Thought it might help