Exemple #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);
            }
        }
Exemple #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);
            }
        }
 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");
    }
        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);
        }
        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);
        }
Exemple #7
0
 public bool DeleteUserRole(UserRole role)
 {
     return(AuthAPI.DeleteUserRole(role.Id));
 }
Exemple #8
0
 public List <Operation> GetOperations(int branchId)
 {
     return(AuthAPI.getOperations(branchId));
 }
Exemple #9
0
 public List <Module> GetModulesByRole(int roleId, int branchId)
 {
     return(AuthAPI.GetModulesByRole(roleId, branchId));
 }
Exemple #10
0
 public int InsertOrUpdateUserGroup(UserGroup group)
 {
     return(AuthAPI.InsertOrUpdateUserGroup(group));
 }
Exemple #11
0
 public bool DeleteUserGroup(UserGroup group)
 {
     return(AuthAPI.DeleteUserGroup(group.Id));
 }
Exemple #12
0
 public List <UserGroup> GetUserGroups(int branchId)
 {
     return(AuthAPI.GetUserGroups(branchId));
 }
Exemple #13
0
 public int InsertOrUpdateUserRole(UserRole role)
 {
     return(AuthAPI.InsertOrUpdateUserRole(role));
 }
Exemple #14
0
 public List <UserRole> GetUserRoles(int branchId)
 {
     return(AuthAPI.GetUserRoles(branchId));
 }
Exemple #15
0
 public int InsertOrUpdateUser(User user)
 {
     return(AuthAPI.InsertOrUpdateUser(user));
 }
Exemple #16
0
 public bool DeleteUser(User user)
 {
     return(AuthAPI.DeleteUser(user.Id));
 }
Exemple #17
0
 public User GetUserByCredentials(Credential credential)
 {
     return(AuthAPI.GetUserByCredentials(credential.UserName, credential.Password));
 }
Exemple #18
0
 public bool AssignPermissions(AssignRolePrivilegeRequest rolePrivilegeRequest)
 {
     return(AuthAPI.AssignPermissions(rolePrivilegeRequest.moduleList));
 }