Beispiel #1
0
        public async Task <Tuple <string, string> > GetAccessToken(string code)
        {
            HaravanAPIAuthorizer      authorizer = GetAuthorizer();
            HaravanAuthorizationState authState  = authorizer.AuthorizeClient(code);

            if (authState != null && authState.AccessToken != null)
            {
                return(new Tuple <string, string>(authState.AccessToken, authState.ShopName));
            }
            return(new Tuple <string, string>("", ""));
        }
Beispiel #2
0
        public void AuthorizerTest()
        {
            var redirect = "http://localhost:8000/finalize";

            var authorizer = new HaravanAPIAuthorizer("mrshop", "317d665f79f81602907ea633c125e6a9", "41469500e03a9ffd9d7b9df38a5710cd", redirect);

            var urlauthorize = authorizer.GetAuthorizationURL(new string[] { "read_products", "write_products" });

            var code = "7a42ebd12bf6498a915fbb368b6bbb0518ed730ea2184d4197b0cb1fa39e2554";

            var authorizeState = authorizer.AuthorizeClient(code);
        }