This documentation is archived and is not being maintained.

My.User.IsAuthenticated Property

Visual Studio 2008

Gets a value that indicates whether the user has been authenticated.

' Usage
Dim value As Boolean = My.User.IsAuthenticated
' Declaration
Public ReadOnly Property IsAuthenticated As Boolean

True if the user was authenticated; otherwise, False.

The My.User.IsAuthenticated property allows your code to determine if the current user has been authenticated.

NoteNote:

The exact behavior of My.User object depends on the type of the application and on the operating system on which the application runs. For more information, see My.User Object.

This example verifies that the user has been authenticated before accessing a resource.

If My.User.IsAuthenticated Then 
    ' Insert code to access a resource here. 
End If

Namespace: Microsoft.VisualBasic.ApplicationServices

Class: User, WebUser

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

Availability by Project Type

Project type

Available

Windows Application

Yes

Class Library

Yes

Console Application

Yes

Windows Control Library

Yes

Web Control Library

Yes

Windows Service

Yes

Web Site

Yes

The following permission may be necessary:

Permission

Description

SecurityPermission

Describes a set of security permissions applied to code. Associated enumeration: ControlPrincipal.

For more information, see Code Access Security and Requesting Permissions.

Show: