OpenAuth.Login Method

.NET Framework 4

Logs in a user via OpenAuth using the specified authentication provider and provider user ID. The user must already be registered with the site with this OpenAuth provider.

Namespace:  Microsoft.AspNet.Membership.OpenAuth
Assembly:  Microsoft.AspNet.Membership.OpenAuth (in Microsoft.AspNet.Membership.OpenAuth.dll)

Syntax

'Declaration
Public Shared Function Login ( _
    providerName As String, _
    providerUserId As String, _
    createPersistentCookie As Boolean _
) As Boolean
'Usage
Dim providerName As String 
Dim providerUserId As String 
Dim createPersistentCookie As Boolean 
Dim returnValue As Boolean 

returnValue = OpenAuth.Login(providerName, _
    providerUserId, createPersistentCookie)
public static bool Login(
    string providerName,
    string providerUserId,
    bool createPersistentCookie
)
public:
static bool Login(
    String^ providerName, 
    String^ providerUserId, 
    bool createPersistentCookie
)
static member Login : 
        providerName:string * 
        providerUserId:string * 
        createPersistentCookie:bool -> bool
public static function Login(
    providerName : String, 
    providerUserId : String, 
    createPersistentCookie : boolean
) : boolean

Parameters

  • providerName
    Type: System.String
    The authentication provider name.
  • providerUserId
    Type: System.String
    The user ID of the user with the authentication provider.
  • createPersistentCookie
    Type: System.Boolean
    A flag indicating whether the login cookie created should be persistent.

Return Value

Type: System.Boolean
True if the user was logged in successfully, false if the login failed, e.g. if the user is not currently registered.

See Also

Reference

OpenAuth Class

Microsoft.AspNet.Membership.OpenAuth Namespace