Class OAuthClientBase
Inheritance
System.Object
OAuthClientBase
Assembly: DotNetNuke.dll
Syntax
public abstract class OAuthClientBase : object
Constructors
|
Improve this Doc
View Source
OAuthClientBase(Int32, AuthMode, String)
Declaration
protected OAuthClientBase(int portalId, AuthMode mode, string service)
Parameters
Type |
Name |
Description |
System.Int32 |
portalId |
|
AuthMode |
mode |
|
System.String |
service |
|
Fields
|
Improve this Doc
View Source
OAuthTokenKey
Declaration
protected const string OAuthTokenKey = null
Field Value
Type |
Description |
System.String |
|
Properties
|
Improve this Doc
View Source
AccessToken
Declaration
protected string AccessToken { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
APIKey
Declaration
protected string APIKey { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
APIResource
Declaration
protected string APIResource { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
APISecret
Declaration
protected string APISecret { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
AuthorizationEndpoint
Declaration
protected Uri AuthorizationEndpoint { get; set; }
Property Value
|
Improve this Doc
View Source
AuthToken
Declaration
protected string AuthToken { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
AuthTokenExpiry
Declaration
protected TimeSpan AuthTokenExpiry { get; set; }
Property Value
Type |
Description |
TimeSpan |
|
|
Improve this Doc
View Source
AuthTokenName
Declaration
protected string AuthTokenName { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
AutoMatchExistingUsers
Declaration
public virtual bool AutoMatchExistingUsers { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CallbackUri
Declaration
public Uri CallbackUri { get; set; }
Property Value
|
Improve this Doc
View Source
MeGraphEndpoint
Declaration
protected Uri MeGraphEndpoint { get; set; }
Property Value
|
Improve this Doc
View Source
Mode
Declaration
protected AuthMode Mode { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
protected string OAuthHeaderCode { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
OAuthVerifier
Declaration
protected string OAuthVerifier { get; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
OAuthVersion
Declaration
protected string OAuthVersion { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
PrefixServiceToUserName
Declaration
public virtual bool PrefixServiceToUserName { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
RequestTokenEndpoint
Declaration
protected Uri RequestTokenEndpoint { get; set; }
Property Value
|
Improve this Doc
View Source
RequestTokenMethod
Declaration
protected HttpMethod RequestTokenMethod { get; set; }
Property Value
|
Improve this Doc
View Source
Scope
Declaration
protected string Scope { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Service
Declaration
public string Service { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
TokenEndpoint
Declaration
protected Uri TokenEndpoint { get; set; }
Property Value
|
Improve this Doc
View Source
TokenMethod
Declaration
protected HttpMethod TokenMethod { get; set; }
Property Value
|
Improve this Doc
View Source
TokenSecret
Declaration
protected string TokenSecret { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
UserGuid
Declaration
protected string UserGuid { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
UserGuidKey
Declaration
protected virtual string UserGuidKey { get; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
VerificationCode
Declaration
protected string VerificationCode { get; }
Property Value
Type |
Description |
System.String |
|
Methods
|
Improve this Doc
View Source
AuthenticateUser(UserData, PortalSettings, String, Action<NameValueCollection>, Action<UserAuthenticatedEventArgs>)
Declaration
public virtual void AuthenticateUser(UserData user, PortalSettings settings, string ipAddress, Action<NameValueCollection> addCustomProperties, Action<UserAuthenticatedEventArgs> onAuthenticated)
Parameters
|
Improve this Doc
View Source
Authorize()
Declaration
public virtual AuthorisationResult Authorize()
Returns
|
Improve this Doc
View Source
GenerateNonce()
Declaration
protected virtual string GenerateNonce()
Returns
Type |
Description |
System.String |
A 6-7 character length nonce string.
|
|
Improve this Doc
View Source
GenerateSignature(Uri, String, String, String, String, String, String, String, out String, out List<QueryParameter>)
Generates a signature using the HMAC-SHA1 algorithm.
Declaration
public string GenerateSignature(Uri url, string token, string tokenSecret, string callbackurl, string oauthVerifier, string httpMethod, string timeStamp, string nonce, out string normalizedUrl, out List<QueryParameter> requestParameters)
Parameters
Type |
Name |
Description |
Uri |
url |
The full url that needs to be signed including its non OAuth url parameters.
|
System.String |
token |
The token, if available. If not available pass null or an empty string.
|
System.String |
tokenSecret |
The token secret, if available. If not available pass null or an empty string.
|
System.String |
callbackurl |
|
System.String |
oauthVerifier |
This value MUST be included when exchanging Request Tokens for Access Tokens. Otherwise pass a null or an empty string.
|
System.String |
httpMethod |
The http method used. Must be a valid HTTP method verb (POST,GET,PUT, etc).
|
System.String |
timeStamp |
|
System.String |
nonce |
|
System.String |
normalizedUrl |
|
List<QueryParameter> |
requestParameters |
|
Returns
Type |
Description |
System.String |
A base64 string of the hash value.
|
|
Improve this Doc
View Source
GenerateTimeStamp()
Generate the timestamp for the signature.
Declaration
protected virtual string GenerateTimeStamp()
Returns
Type |
Description |
System.String |
A string representation of in the Unix timestamp format.
|
|
Improve this Doc
View Source
GetCurrentUser<TUserData>()
Declaration
public virtual TUserData GetCurrentUser<TUserData>()
where TUserData : UserData
Returns
Type |
Description |
TUserData |
|
Type Parameters
Name |
Description |
TUserData |
|
|
Improve this Doc
View Source
GetExpiry(String)
Declaration
protected virtual TimeSpan GetExpiry(string responseText)
Parameters
Type |
Name |
Description |
System.String |
responseText |
|
Returns
Type |
Description |
TimeSpan |
|
|
Improve this Doc
View Source
GetToken(String)
Declaration
protected virtual string GetToken(string responseText)
Parameters
Type |
Name |
Description |
System.String |
responseText |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
HaveVerificationCode()
Declaration
public bool HaveVerificationCode()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsCurrentService()
Declaration
public bool IsCurrentService()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsCurrentUserAuthorized()
Declaration
public bool IsCurrentUserAuthorized()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LoadTokenCookie(String)
Declaration
protected void LoadTokenCookie(string suffix)
Parameters
Type |
Name |
Description |
System.String |
suffix |
|
|
Improve this Doc
View Source
RemoveToken()
Declaration
public void RemoveToken()
|
Improve this Doc
View Source
UrlEncode(String)
This is a different URL Encode implementation since the default .NET one outputs the percent encoding in lower case.
While this is not a problem with the percent encoding spec, it is used in upper case throughout OAuth.
Declaration
public static string UrlEncode(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
The value to URL encode.
|
Returns
Type |
Description |
System.String |
Returns a URL encoded string.
|
Extension Methods