UnauthorizedException Class

IT Hit WebDAV for .NET

Incorrect credentials provided or insufficient permissions to access the requested item.

For a list of all members of this type, see UnauthorizedException Members.

System.Object
   System.Exception
      ITHit.WebDAV.Client.Exceptions.WebDavException
         ITHit.WebDAV.Client.Exceptions.WebDavHttpException
            ITHit.WebDAV.Client.Exceptions.UnauthorizedException

[Visual Basic]
Public Class UnauthorizedException
    Inherits WebDavHttpException
[C#]
public class UnauthorizedException : WebDavHttpException

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Thrown when server responded with 401 (Unauthorized) http response. The request requires user authentication. The client MAY repeat the request with a suitable Authorization header field. If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity might include relevant diagnostic information.

Example

 string license = "<?xml version='1.0' encoding='utf...
 WebDavSession session = new WebDavSession(license);
 session.Credentials = new NetworkCredential("User1", "pwd");

 IFolder folder = null;
 try
 {
     folder = session.OpenFolder(new Uri("http://server:8080/Products"));
 }
 catch(UnauthorizedException)
 {
     Console.WriteLine("Incorrect user name or password.");
 }
 catch(NotFoundException)
 {
     Console.WriteLine("Folder not found.");
 }

 if(folder!=null)
 {
     Console.WriteLine(folder.LastModified.ToString());
 }
 

Requirements

Namespace: ITHit.WebDAV.Client.Exceptions

Assembly: ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll)

See Also

UnauthorizedException Members | ITHit.WebDAV.Client.Exceptions Namespace