Ejemplo n.º 1
0
        public void GetAuthorizationUrl()
        {
            var authenticator    = new TokenProvider("clientId", "clientSecret");
            var authorizationUrl = authenticator.GetAuthorizationUrl("http://foo.com");

            Assert.That(authorizationUrl, Is.EqualTo("https://api.box.com/oauth2/authorize?response_type=code&client_id=clientId&state=authenticated&redirect_uri=http%3A%2F%2Ffoo.com"));
        }
        public ActionResult InitiateAuthorization(string clientId, string clientSecret)
        {
            Session[ClientId]     = clientId;
            Session[ClientSecret] = clientSecret;
            var boxAuthenticator = new TokenProvider(clientId, clientSecret);

            return(new RedirectResult(boxAuthenticator.GetAuthorizationUrl()));
        }