C# Класс Teference.Shopify.Api.ShopifyOAuth

Authentication and authorize your application against SHOPIFY API OAUTH 2.0 implementation.
Наследование: IShopifyOAuth
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
ByteArrayToHexString ( ICollection byteData ) : string
ValidateInstallResponse ( OAuthState installState ) : bool

Описание методов

AuthorizeClient() публичный Метод

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.
Результат OAuthState

AuthorizeClient() публичный Метод

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.
Результат OAuthState

GetOAuthUrl() публичный Метод

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.
Результат string

ShopifyOAuth() публичный Метод

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
Результат System

ShopifyOAuth() публичный Метод

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.
Результат System