Class AuthenticationService

Provides the client proxy class for the authentication service. The AuthenticationService class is a singleton; it has only one instance with a global point of access. It is always available to your application and you do not have to instantiate it. The AuthenticationService class provides script access to user authentication. It calls methods of the authentication service through the same infrastructure used to call any other Web service method.

see

{@link http://msdn.microsoft.com/en-us/library/bb310861(v=vs.100).aspx}

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): AuthenticationService

Initializes a new instance of the Sys.Services.AuthenticationService class.

Returns

AuthenticationService

Properties

public DefaultWebServicePath: string

Specifies the path of the default authentication service.

Methods

public defaultSucceededCallback(): Function

Gets or sets the default succeeded callback function for the service.

Returns

Function

A reference to the succeeded callback function for the service.

public defaultSucceededCallback(value: Function)

Gets or sets the default succeeded callback function for the service.

Parameters

  • value: Function
          A reference to the succeeded callback function for the service.
    

public defaultUserContext(): Object

Gets or sets the default user context for the service.

Returns

Object

A reference to the user context for the service.

public defaultUserContext(value: Object)

Gets or sets the default user context for the service.

Parameters

  • value: Object
      A reference to the user context for the service.
    

public get_defaultFailedCallback(): Function

Gets or sets the name of the default failure callback function.

Returns

Function

public get_isLoggedIn(): boolean

Gets the authentication state of the current user. The value of this property is set by the ScriptManager object during a page request.

Returns

boolean

true if the current user is logged in; otherwise, false.

public get_path(): string

Gets or sets the authentication service path. By default, the path property is set to an empty string. If you do not set the path property, the internal default path is used, which points to the built-in authentication service.

Returns

string

public get_timeout(): number

Gets or sets the authentication service time-out value. The timeout property represents the time in milliseconds that the current instance of the Sys.Net.WebRequestExecutor class should wait before timing out the request. The timeout in milliseconds

Returns

number

  The timeout

public login(userName: string, password: string, isPersistent: boolean, customInfo: any, redirectUrl: string, loginCompletedCallback: Function, failedCallback: Function, userContext: any)

Authenticates the user's credentials.

exception

Sys.ArgumentNullException - username is null.

Parameters

  • userName: string

    (required) The user name to authenticate.

  • password: string
          The user's password. The default is null.
    
  • isPersistent: boolean
          true if the issued authentication ticket should be persistent across browser sessions; otherwise, false. The default is false.
    
  • customInfo: any
  • redirectUrl: string
  • loginCompletedCallback: Function
          The function to call when the login has finished successfully. The default is null.
    
  • failedCallback: Function
          The function to call if the login fails. The default is null.
    
  • userContext: any
          User context information that you are passing to the callback functions.
    

public logout(redirectUrl: string, logoutCompletedCallback: Function, failedCallback: Function, userContext: any)

Logs out the currently authenticated user.

If redirectUrl is null or is an empty string, the page is redirected to itself after the call to the authentication Web service finishes and the completed callback function is called. This makes sure that any user-related data is cleared from the page. If redirectUrl is not null or is a non-empty string, the page is redirected to the specified URL after a successful call to the Web service. This URL can be an absolute virtual path, a relative virtual path, or a fully qualified domain name and a path. If the call to the Web service fails, the page is not redirected or refreshed. Instead, the failed callback function is called.

Parameters

  • redirectUrl: string
          The URL to redirect the browser to on successful logout. The default is null.
    
  • logoutCompletedCallback: Function
          The function that is called when the logout has finished. The default is null.
    
  • failedCallback: Function
          The function that is called if the logout has failed. The default is null.
    
  • userContext: any
           User context information that you are passing to the callback functions.
    

public set_defaultFailedCallback(value: string)

Gets or sets the name of the default failure callback function.

Parameters

  • value: string
          A string that contains the name of the default failure callback function.
    

public set_path(value: string)

Gets or sets the authentication service path. You usually set the path property in declarative markup. This value can be an absolute virtual path, a relative virtual path, or a fully qualified domain name and a path. By default, the path property is set to an empty string. If you do not set the path property, the internal default path is used, which points to the built-in authentication service.

Parameters

  • value: string
          The authentication service path.
    

public set_timeout(value: number)

Gets or sets the authentication service time-out value. The timeout property represents the time in milliseconds that the current instance of the Sys.Net.WebRequestExecutor class should wait before timing out the request. By setting a time-out interval, you can make sure that a pending request returns based on a time interval that you specify, instead of waiting for the asynchronous communication layer to time out.

Parameters

  • value: number
          The time-out value in milliseconds.