REST Authentication

Hello everyone!

Maybe you can show me what I'm doing wrong. My goal is to change the parameters with Rest Api and Powershell but I have stuck on the Authentication part.

So this code with the guest accesses is working:

Invoke-WebRequest -Uri "$serverAddress/guestAuth/app/rest/projects?projectId=_Root" -ContentType "application/xml" -Method Get

while this return a login page

Invoke-WebRequest -Uri "$serverAddress/app/rest/projects?projectId=_Root" -ContentType "application/xml" -Method Get 
-Headers @{Origin= '$serverAddress';Authorization= 'Bearer $token'} -UseBasicParsing

Please sign in to leave a comment.