Ejemplo n.º 1
0
        private async void btnGetAuthToken_Click(object sender, EventArgs e)
        {
            try
            {
                lblOutCome.Text = "Please Wait...";
                await Task.Delay(200);

                if (GstSession.ApiLoginDetails == null)
                {
                    GstSession.ApiLoginDetails = new APILoginDetails();
                }
                if (GstSession.ApiLoginDetails.GSTIN != txtGSTIN.Text)
                {
                    GstSession.ApiLoginDetails.GSTIN           = txtGSTIN.Text;
                    GstSession.ApiLoginDetails.GstPortalUserID = txtGSTUserID.Text;
                }
                TxnRespWithObj <APISession> AuthResp = await AuthAPI.GetAuthTokenAsync(GstSession, txtOTP.Text);

                lblOutCome.Text = AuthResp.TxnOutcome + "\nAuth Token (Please Store): " + GstSession.ApiLoginDetails.AuthToken +
                                  "\nSession EK: " + GstSession.ApiLoginDetails.SessionEK +
                                  "\nExpiary: " + GstSession.ApiLoginDetails.TokenExp;
                //Save Updated Details
                Shared.SaveAPISetting(GstSession.ApiSetting);
                Shared.SaveAPILoginDetails(GstSession.ApiLoginDetails);
                ShowUpdatedAPILoginDetails();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private async void btnGetOTP_Click(object sender, EventArgs e)
        {
            try
            {
                lblOutCome.Text = "Wait...";
                await Task.Delay(200);

                if (GstSession.ApiLoginDetails == null)
                {
                    GstSession.ApiLoginDetails = new APILoginDetails();
                }
                if (GstSession.ApiLoginDetails.GSTIN != txtGSTIN.Text)
                {
                    GstSession.ApiLoginDetails.GSTIN           = txtGSTIN.Text;
                    GstSession.ApiLoginDetails.GstPortalUserID = txtGSTUserID.Text;
                }
                TxnRespWithRefAck otpResp = await AuthAPI.GetOTPAsync(GstSession);

                lblOutCome.Text = otpResp.IsSuccess.ToString() + " - " + otpResp.TxnOutcome +
                                  "\nAppKey Established (Please Store): " + otpResp.RefOrAckNo;
                //Save Updated Details
                Shared.SaveAPISetting(GstSession.ApiSetting);
                Shared.SaveAPILoginDetails(GstSession.ApiLoginDetails);
                ShowUpdatedAPILoginDetails();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 3
0
 private void Start()
 {
     DontDestroyOnLoad(gameObject);
     Instance    = this;
     databaseAPI = GetComponent <DatabaseAPI>();
     authAPI     = GetComponent <AuthAPI>();
     SceneManager.LoadScene(1);
 }
    void Start()
    {
        DontDestroyOnLoad(gameObject);
        Instance = this;

        AuthAPI = GetComponent <AuthAPI>();

        SceneManager.LoadScene("01 UI MainMenu");
    }
Ejemplo n.º 5
0
        public void Configuration(IAppBuilder app)
        {
            // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888
            app.MapSignalR();
            app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);

            var myProvider = new AuthAPI();
            OAuthAuthorizationServerOptions options = new OAuthAuthorizationServerOptions
            {
                AllowInsecureHttp         = true,
                TokenEndpointPath         = new PathString("/token"),
                AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),
                Provider = myProvider
            };

            app.UseOAuthAuthorizationServer(options);
            app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());


            HttpConfiguration config = new HttpConfiguration();

            WebApiConfig.Register(config);
        }
Ejemplo n.º 6
0
        public HelpAddingWindow(AuthAPI.Authenticator auth)
        {
            InitializeComponent();

            PROGRESS_AuthCode.Maximum = AuthAPI.BlizzardAPI.HOTP_PERIOD_LENGTH - 1;

            LINK_BattleNet.Click += new RoutedEventHandler(LINK_BattleNet_Click);

            this.auth = auth;

            authTimer = new DispatcherTimer();
            authTimer.Interval = TimeSpan.FromMilliseconds(100);
            authTimer.Tick += new EventHandler(authTimer_Tick);

            TEXT_Serial.Text = auth.Serial;

            this.RefreshAuthenticatorData();

            TEXT_AuthCode.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(TEXT_PreviewMouseLeftButtonDown);
            TEXT_Serial.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(TEXT_PreviewMouseLeftButtonDown);

            this.Closing += new System.ComponentModel.CancelEventHandler(HelpAddingWindow_Closing);
        }
Ejemplo n.º 7
0
 public bool DeleteUserRole(UserRole role)
 {
     return(AuthAPI.DeleteUserRole(role.Id));
 }
Ejemplo n.º 8
0
 public List <Operation> GetOperations(int branchId)
 {
     return(AuthAPI.getOperations(branchId));
 }
Ejemplo n.º 9
0
 public List <Module> GetModulesByRole(int roleId, int branchId)
 {
     return(AuthAPI.GetModulesByRole(roleId, branchId));
 }
Ejemplo n.º 10
0
 public int InsertOrUpdateUserGroup(UserGroup group)
 {
     return(AuthAPI.InsertOrUpdateUserGroup(group));
 }
Ejemplo n.º 11
0
 public bool DeleteUserGroup(UserGroup group)
 {
     return(AuthAPI.DeleteUserGroup(group.Id));
 }
Ejemplo n.º 12
0
 public List <UserGroup> GetUserGroups(int branchId)
 {
     return(AuthAPI.GetUserGroups(branchId));
 }
Ejemplo n.º 13
0
 public int InsertOrUpdateUserRole(UserRole role)
 {
     return(AuthAPI.InsertOrUpdateUserRole(role));
 }
Ejemplo n.º 14
0
 public List <UserRole> GetUserRoles(int branchId)
 {
     return(AuthAPI.GetUserRoles(branchId));
 }
Ejemplo n.º 15
0
 public int InsertOrUpdateUser(User user)
 {
     return(AuthAPI.InsertOrUpdateUser(user));
 }
Ejemplo n.º 16
0
 public bool DeleteUser(User user)
 {
     return(AuthAPI.DeleteUser(user.Id));
 }
Ejemplo n.º 17
0
 public User GetUserByCredentials(Credential credential)
 {
     return(AuthAPI.GetUserByCredentials(credential.UserName, credential.Password));
 }
Ejemplo n.º 18
0
 public bool AssignPermissions(AssignRolePrivilegeRequest rolePrivilegeRequest)
 {
     return(AuthAPI.AssignPermissions(rolePrivilegeRequest.moduleList));
 }