예제 #1
0
        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);
        }