/// <summary> /// Reports the results of an SSO action. /// </summary> /// <param name="success">Was SSO authentication completed successfully?</param> /// <param name="rallyServer">The server that the ZSessionID is for.</param> /// <param name="zSessionID">The zSessionID that was returned from Rally.</param> protected void ReportSsoResults(bool success, string rallyServer, string zSessionID) { if (SsoAuthenticationComplete != null) { if (success) { RallyRestApi.AuthenticationResult authResult = Api.AuthenticateWithZSessionID(Api.ConnectionInfo.UserName, zSessionID, rallyServer: rallyServer); if (authResult == RallyRestApi.AuthenticationResult.Authenticated) { LoginDetails.SaveToDisk(); NotifyLoginWindowSsoComplete(authResult, Api); SsoAuthenticationComplete.Invoke(authResult, Api); return; } } LoginDetails.MarkUserAsLoggedOut(); Api.Logout(); NotifyLoginWindowSsoComplete(RallyRestApi.AuthenticationResult.NotAuthorized, null); SsoAuthenticationComplete.Invoke(RallyRestApi.AuthenticationResult.NotAuthorized, null); } }
/// <summary> /// Performs an logout from Rally. /// </summary> /// <example> /// <code language="C#"> /// authMgr.PerformLogoutFromRally(); /// </code> /// </example> protected void PerformLogoutFromRally() { Api.Logout(); LoginDetails.MarkUserAsLoggedOut(); AuthenticationStateChange.Invoke(Api.AuthenticationState, null); }