public void LiveAuthClient_GetLogoutUrl_Normal() { LiveAuthClient authClient = new LiveAuthClient("000000004802B729", "password", null); string url = authClient.GetLogoutUrl("http://www.foo.com/callback"); Assert.AreEqual("https://login.live.com/oauth20_logout.srf?client_id=000000004802B729&redirect_uri=http%3A%2F%2Fwww.foo.com%2Fcallback", url); }
public void Logout() { var liveAuthClient = new LiveAuthClient("000000004811DB42"); string logoutUrl = liveAuthClient.GetLogoutUrl(); var authForm = new LiveAuthWindow( logoutUrl, null, "Logout" ); authForm.LogOut(logoutUrl); }
protected void Page_Load(object sender, EventArgs e) { string login = Request["login"]; string logout = Request["logout"]; string returnUrl = Request["ReturnUrl"]; if (login != null) { string[] scopes = new string[] { "wl.signin", "wl.basic" }; string loginUrl = liveAuthClient.GetLoginUrl(scopes, "https://jitad2015.waw.pl/Konto/webauth"); Response.Redirect(loginUrl, true); } if (logout != null) { if (returnUrl != null) { returnUrl = "&ReturnUrl=" + returnUrl; } string logoutUrl = "https://jitad2015.waw.pl/Konto/webauth?l=1" + returnUrl; if (logout == "2") { goto noneMS; } logoutUrl = liveAuthClient.GetLogoutUrl("https://jitad2015.waw.pl/Konto/webauth?l=1" + returnUrl); liveAuthClient.ClearSession(new HttpContextWrapper(Context)); noneMS: Session.Abandon(); Response.Redirect(logoutUrl, true); } if (Request["l"] != null) { if (returnUrl != null) { Response.Redirect("~/" + returnUrl, true); } else { Response.Redirect("~/", true); } } RegisterAsyncTask(new PageAsyncTask(getAuthResult)); }
public string GetLogoutUrl(string returnUrl) { return(_liveAuthClient.GetLogoutUrl(returnUrl)); }
public string GetLogoutUrl() { return(_liveAuthClient.GetLogoutUrl(GetRedirectUrl())); }