OpenAuthManager.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 Overridable Function Login ( _
    context As HttpContextBase, _
    providerName As String, _
    providerUserId As String, _
    createPersistentCookie As Boolean _
) As Boolean
'Usage
Dim instance As OpenAuthManager 
Dim context As HttpContextBase 
Dim providerName As String 
Dim providerUserId As String 
Dim createPersistentCookie As Boolean 
Dim returnValue As Boolean 

returnValue = instance.Login(context, _
    providerName, providerUserId, createPersistentCookie)
public virtual bool Login(
    HttpContextBase context,
    string providerName,
    string providerUserId,
    bool createPersistentCookie
)
public:
virtual bool Login(
    HttpContextBase^ context, 
    String^ providerName, 
    String^ providerUserId, 
    bool createPersistentCookie
)
abstract Login : 
        context:HttpContextBase * 
        providerName:string * 
        providerUserId:string * 
        createPersistentCookie:bool -> bool  
override Login : 
        context:HttpContextBase * 
        providerName:string * 
        providerUserId:string * 
        createPersistentCookie:bool -> bool
public function Login(
    context : HttpContextBase, 
    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

OpenAuthManager Class

Microsoft.AspNet.Membership.OpenAuth Namespace