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); } }
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); }
public bool DeleteUserRole(UserRole role) { return(AuthAPI.DeleteUserRole(role.Id)); }
public List <Operation> GetOperations(int branchId) { return(AuthAPI.getOperations(branchId)); }
public List <Module> GetModulesByRole(int roleId, int branchId) { return(AuthAPI.GetModulesByRole(roleId, branchId)); }
public int InsertOrUpdateUserGroup(UserGroup group) { return(AuthAPI.InsertOrUpdateUserGroup(group)); }
public bool DeleteUserGroup(UserGroup group) { return(AuthAPI.DeleteUserGroup(group.Id)); }
public List <UserGroup> GetUserGroups(int branchId) { return(AuthAPI.GetUserGroups(branchId)); }
public int InsertOrUpdateUserRole(UserRole role) { return(AuthAPI.InsertOrUpdateUserRole(role)); }
public List <UserRole> GetUserRoles(int branchId) { return(AuthAPI.GetUserRoles(branchId)); }
public int InsertOrUpdateUser(User user) { return(AuthAPI.InsertOrUpdateUser(user)); }
public bool DeleteUser(User user) { return(AuthAPI.DeleteUser(user.Id)); }
public User GetUserByCredentials(Credential credential) { return(AuthAPI.GetUserByCredentials(credential.UserName, credential.Password)); }
public bool AssignPermissions(AssignRolePrivilegeRequest rolePrivilegeRequest) { return(AuthAPI.AssignPermissions(rolePrivilegeRequest.moduleList)); }