public static bool DolLogin(LoginData login, CxWebServiceClient client)
        {
            bool loginSucceeded = false;

            _oidcLoginHelper.resetLatestResult();
            OidcLoginResult oidcLoginResult = _oidcLoginHelper.ConnectToIdentidyProvider(login.ServerBaseUri);

            if (oidcLoginResult.IsSuccessful)
            {
                //Add logs for print Server url and AccessToken
                Logger.Create().Debug("Server URL: " + login.ServerBaseUri);
                cxRestApi = new CxRESTApi(login);
                string accessToken = cxRestApi.Login(oidcLoginResult.Code);
                cxRestApi.GetPermissions(accessToken);
                loginSucceeded = true;
                Logger.Create().Debug("Succeeded to login. ");
            }
            else
            {
                Logger.Create().Debug("Server URL: " + login.ServerBaseUri);
                _oidcLoginHelper.CloseLoginWindow();
                Logger.Create().Debug("Failed to login. ");
            }
            return(loginSucceeded);
        }
示例#2
0
        public static bool DolLogin(LoginData login, CxWebServiceClient client)
        {
            bool loginSucceeded = false;

            _oidcLoginHelper.resetLatestResult();
            OidcLoginResult oidcLoginResult = _oidcLoginHelper.ConnectToIdentidyProvider(login.ServerBaseUri);

            if (oidcLoginResult.IsSuccessful)
            {
                cxRestApi = new CxRESTApi(login);
                string accessToken = cxRestApi.Login(oidcLoginResult.Code);
                cxRestApi.GetPermissions(accessToken);
                loginSucceeded = true;
            }
            else
            {
                _oidcLoginHelper.CloseLoginWindow();
            }
            return(loginSucceeded);
        }