C# Class Teference.Shopify.Api.ShopifyOAuth

Authentication and authorize your application against SHOPIFY API OAUTH 2.0 implementation.
Inheritance: IShopifyOAuth
显示文件 Open project: teference/shopify-dotnet

Public Methods

Method Description
AuthorizeClient ( NameValueCollection queryStringCollection ) : OAuthState

Performs SHOPIFY OAUTH 2.0 authorization process based on shop access permission accepted.

AuthorizeClient ( string shopName, string authorizationCode, string hmacHash, string timestamp ) : OAuthState

Performs SHOPIFY OAUTH 2.0 authorization process based on shop access permission accepted.

GetOAuthUrl ( string shopName, OAuthScope scope ) : string

Get URL to use for redirection at SHOPIFY OAUTH 2.0 authorization server, asking for permission to access intended store.

ShopifyOAuth ( ) : System

Initializes a new instance of the ShopifyOAuth class.

If initializes with empty constructor, library expected two application setting to be found in 'web.config' / 'app.config'.

1. 'shopify-dotnet-api-key' - Shopify application API key.

2. 'shopify-dotnet-secret-key' - Shopify application shared secret key.

ShopifyOAuth ( OAuthConfiguration configuration ) : System

Initializes a new instance of the ShopifyOAuth class.

Use this constructor in case you do not wish this library to fetch API and Secret Key from configuration file.

Private Methods

Method Description
ByteArrayToHexString ( ICollection byteData ) : string
ValidateInstallResponse ( OAuthState installState ) : bool

Method Details

AuthorizeClient() public method

Performs SHOPIFY OAUTH 2.0 authorization process based on shop access permission accepted.
Throws argument null exception if input parameters are null or empty.
public AuthorizeClient ( NameValueCollection queryStringCollection ) : OAuthState
queryStringCollection System.Collections.Specialized.NameValueCollection Instance of name value collection of query string returned in request of the callback URL by SHOPIFY authorization server.
return OAuthState

AuthorizeClient() public method

Performs SHOPIFY OAUTH 2.0 authorization process based on shop access permission accepted.
Throws argument null exception if input parameters are null or empty.
public AuthorizeClient ( string shopName, string authorizationCode, string hmacHash, string timestamp ) : OAuthState
shopName string Authorization shop name.
authorizationCode string Intermediate authorization code, required to complete SHOPIFY OAUTH 2.0 authorization.
hmacHash string HMAC hash value.
timestamp string Timestamp value returned in the callback query string.
return OAuthState

GetOAuthUrl() public method

Get URL to use for redirection at SHOPIFY OAUTH 2.0 authorization server, asking for permission to access intended store.
Throws argument null exception if input parameters are null or empty.
public GetOAuthUrl ( string shopName, OAuthScope scope ) : string
shopName string Authorization shop name (w/o '.myshopify.com', only shop name). In case it contains '.myshopify.com' then it would be trimmed out to continue
scope OAuthScope SHOPIFY OAUTH 2.0 permission scope(s) for which store admin will be asked permission for.
return string

ShopifyOAuth() public method

Initializes a new instance of the ShopifyOAuth class.

If initializes with empty constructor, library expected two application setting to be found in 'web.config' / 'app.config'.

1. 'shopify-dotnet-api-key' - Shopify application API key.

2. 'shopify-dotnet-secret-key' - Shopify application shared secret key.

Throws argument null exception if 'shopify-dotnet-api-key' and 'shopify-dotnet-secret-key' not found or empty. Throws argument null exception if 'shopify-dotnet-api-key' and 'shopify-dotnet-secret-key' not found or empty.
public ShopifyOAuth ( ) : System
return System

ShopifyOAuth() public method

Initializes a new instance of the ShopifyOAuth class.

Use this constructor in case you do not wish this library to fetch API and Secret Key from configuration file.

Throws argument null exception if input parameters are null or empty.
public ShopifyOAuth ( OAuthConfiguration configuration ) : System
configuration OAuthConfiguration Instance of OAUTH settings.
return System