Class Unauthenticated

  • All Implemented Interfaces:
    StaticStructure, Structure, java.io.Serializable

    public class Unauthenticated
    extends Error
    implements java.io.Serializable, StaticStructure
    The Unauthenticated exception indicates that the method requires authentication and the user is not authenticated.

    API requests may include a security context containing user credentials. For example, the user credentials could be a SAML token, a user name and password, or the session identifier for a previously established session.

    Examples:

    • The SAML token in the request's security context has expired.
    • The user name and password in the request's security context are invalid.
    • The session identifier in the request's security context identifies a session that has expired.
    Counterexamples:
    • The user is authenticated but isn't authorized to perform the requested method. The Unauthorized exception would be used instead.

    For security reasons, the Error.getData() property in this exception is null, and the Error.getMessages() property in this exception does not disclose which part of the security context is correct or incorrect. For example the messages would not disclose whether a username or a password is valid or invalid, but only that a combination of username and password is invalid.

    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends Structure>
      T
      _convertTo​(java.lang.Class<T> clazz)
      Converts this structure into an instance of the provided class structure if possible.
      java.lang.String _getCanonicalName()
      Returns the canonical name of the structure.
      static java.lang.String _getCanonicalTypeName()
      Returns the canonical type name.
      static com.vmware.vapi.bindings.type.ErrorType _getClassType()
      WARNING: Internal method, subject to change in future versions.
      StructValue _getDataValue()
      Returns this Structure represented in the dynamic DataValue model.
      DataValue _getDynamicField​(java.lang.String fieldName)
      Get a dynamic field value, doesn't allow access to static fields (which have getters/setters).
      java.util.Set<java.lang.String> _getDynamicFieldNames()
      Get the names of the dynamic fields in the structure.
      com.vmware.vapi.bindings.type.ErrorType _getType()
      WARNING: Internal method, subject to change in future versions.
      boolean _hasTypeNameOf​(java.lang.Class<? extends Structure> clazz)
      Checks if the runtime type name of this structure matches the type represented by the specified binding class.
      static Unauthenticated _newInstance​(StructValue structValue)
      WARNING: Internal method, subject to change in future versions.
      Returns new instance of this binding class and injects the provided data value.
      WARNING: The returned object is not fully initialized.
      static Unauthenticated _newInstance2​(StructValue structValue)
      WARNING: Internal method, subject to change in future versions.
      Serves as a versioning mechanism.
      void _setDynamicField​(java.lang.String fieldName, DataValue fieldValue)
      Sets a dynamic field value.
      protected void _updateDataValue​(StructValue structValue)  
      void _validate()
      Validates the state of the discriminated unions and HasFieldsOf restrictions (if any) in this Java language binding Structure.
      boolean equals​(java.lang.Object obj)  
      java.lang.String getChallenge()
      Indicates the authentication challenges applicable to the target API provider.
      java.lang.String getMessage()  
      int hashCode()  
      void setChallenge​(java.lang.String challenge)
      Indicates the authentication challenges applicable to the target API provider.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Unauthenticated

        public Unauthenticated​(java.util.List<LocalizableMessage> messages,
                               Structure data)
        This constructor is provided for backwards compatibility purposes only. Please use the Builder class instead.
      • Unauthenticated

        public Unauthenticated()
        Default constructor.
      • Unauthenticated

        protected Unauthenticated​(StructValue __dynamicStructureFields)
      • Unauthenticated

        protected Unauthenticated​(StructValue __dynamicStructureFields,
                                  Error.Type errorType)
    • Method Detail

      • getChallenge

        public java.lang.String getChallenge()
        Indicates the authentication challenges applicable to the target API provider. It can be used by a client to discover the correct authentication scheme to use. The exact syntax of the value is defined by the specific provider, the protocol and authentication schemes used.

        For example, a provider using REST may adhere to the WWW-Authenticate HTTP header specification, RFC7235, section 4.1. In this case an example challenge value may be: SIGN realm="27da1358-2ba4-11e9-b210-d663bd873d93",sts="http://vcenter/sso?vsphere.local", Basic realm="vCenter"

        This property is optional because it was added in a newer version than its parent node.
        Returns:
        The current value of the property.
      • setChallenge

        public void setChallenge​(java.lang.String challenge)
        Indicates the authentication challenges applicable to the target API provider. It can be used by a client to discover the correct authentication scheme to use. The exact syntax of the value is defined by the specific provider, the protocol and authentication schemes used.

        For example, a provider using REST may adhere to the WWW-Authenticate HTTP header specification, RFC7235, section 4.1. In this case an example challenge value may be: SIGN realm="27da1358-2ba4-11e9-b210-d663bd873d93",sts="http://vcenter/sso?vsphere.local", Basic realm="vCenter"

        This property is optional because it was added in a newer version than its parent node.
        Parameters:
        challenge - New value for the property.
      • _getType

        public com.vmware.vapi.bindings.type.ErrorType _getType()
        Description copied from interface: StaticStructure
        WARNING: Internal method, subject to change in future versions. Returns StructType instance representing the static bindings type for this Structure.
        Specified by:
        _getType in interface StaticStructure
        Overrides:
        _getType in class Error
        Returns:
        the static bindings StructType
      • _getDataValue

        public StructValue _getDataValue()
        Description copied from interface: Structure
        Returns this Structure represented in the dynamic DataValue model.

        Attempts to change the returned StructValue representation are not required to change the state of this structure. Actually the behavior is implementation dependent and is unspecified. In general the returned value shouldn't be changed.

        Specified by:
        _getDataValue in interface Structure
        Overrides:
        _getDataValue in class Error
        Returns:
        StructValue representing this structure
      • _validate

        public void _validate()
        Description copied from interface: StaticStructure
        Validates the state of the discriminated unions and HasFieldsOf restrictions (if any) in this Java language binding Structure.

        More precisely, for each union: given value of the discriminant/tag field (@UnionTag in the IDL) of an union in this structure, validates that:

      • all fields of the union required for that value of the discriminant are set
      • fields of the union that are not allowed for that value of the discriminant are not set
      • any other fields of the structure (not participating in the union) do not affect the validation result
Specified by:
_validate in interface StaticStructure
Overrides:
_validate in class Error