Share via


OAuthWebSecurity.GetUserName Method

Returns the user ID for the specified OAuth or OpenID provider and provider user ID.

Namespace:  Microsoft.Web.WebPages.OAuth
Assembly:  Microsoft.Web.WebPages.OAuth (in Microsoft.Web.WebPages.OAuth.dll)

Syntax

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

returnValue = OAuthWebSecurity.GetUserName(providerName, _
    providerUserId)
public static string GetUserName(
    string providerName,
    string providerUserId
)
public:
static String^ GetUserName(
    String^ providerName, 
    String^ providerUserId
)
static member GetUserName : 
        providerName:string * 
        providerUserId:string -> string
public static function GetUserName(
    providerName : String, 
    providerUserId : String
) : String

Parameters

  • providerUserId
    Type: System.String
    The user ID for the specified provider.

Return Value

Type: System.String
The user ID, or null reference (Nothing in Visual Basic) if there is no user ID associated with the OAuth or Open ID provider user ID.

Remarks

For an example of using the OAuthWebSecurity class, see Using OAuth Providers with MVC 4.

See Also

Reference

OAuthWebSecurity Class

Microsoft.Web.WebPages.OAuth Namespace