vSphere APIs call fails with the error: NotAuthenticated
search cancel

vSphere APIs call fails with the error: NotAuthenticated

book

Article ID: 336368

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
  • The vSphere APIs call fails with the error:

    NotAuthenticated

    System.Xml.XmlElement Actor: Code: ServerFaultCode XML Detail: <detail><NotAuthenticatedFault xmlns="urn:vim25" xsi:type="NotAuthenticated" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><object type="Folder">group-d1</object><privilegeId>System.View</privilegeId></NotAuthenticatedFault></detail>



Environment

VMware vSphere Web Services SDK 4.1

Cause

This issue occurs when vCenter Server cannot identify the session that is used by the API call.

Note: NotAuthenticated exception means the vCenter Server cannot identify the session that is used to make the API call which requires non-anonymous privileges.

The session is not identified by vCenter Server if:
  • It was never created.
  • The user has logged in and then logged out.
  • The session was created, but expired because it was inactive for a long time.

Resolution

This is an expected behavior in VMware vSphere Web Services SDK.

Note: You must login instantly without any additional preparations, such as logging off or invoking any other APIs.