示例#1
0
        public void CreateRequestForAuthCode()
        {
            var authLink = new OAuth2AuthorizeLink()
            {
                AuthorizationServer = new Uri("https://login.live.com/oauth20_authorize.srf"),
                ClientId = "...",
                ResponseType = "code",
                RedirectUri = new Uri("https://login.live.com/oauth20_desktop.srf"),
                Scope = new[] { "wl.signin", "wl.basic", "wl.skydrive_update" }
            };

            var req = authLink.CreateRequest();

            // Copy this URI into the browser, sign in, and then copy the auth code from URL in the browser
        }
示例#2
0
        public void CreateOAuthAuthRequest()
        {

            var authLink = new OAuth2AuthorizeLink()
            {
                AuthorizationServer = new Uri("https://login.live.com/oauth20_authorize.srf"),
                ClientId = "...",
                ResponseType = "code",
                RedirectUri = new Uri("https://login.live.com/oauth20_desktop.srf"),
                Scope = new[] { "wl.signin", "wl.basic", "wl.skydrive" },
                State = ""
            };

            var request = authLink.CreateRequest();

        }
        //[Fact]
        public void CreateRequestForAuthCode()
        {
            var authLink = new OAuth2AuthorizeLink()
            {
                Target = new Uri("https://login.live.com/oauth20_authorize.srf")
            };

            //var req = authLink.CreateRequest(
            //    clientId: "...",
            //    responseType: "code",
            //    redirectUri: new Uri("https://login.live.com/oauth20_desktop.srf"),
            //    scope : new[] { "wl.signin", "wl.basic", "wl.skydrive_update" },
            //    state : null);
            
            // Copy this URI into the browser, sign in, and then copy the auth code from URL in the browser
        }