Posts

rest - PHP Token Authentication - Expiration -

i have hybrid spa php web application makes calls remote rest api it's needs. i'm starting implement token authentication between web server , api , i'm not quite sure how handle expiration of token. there may flaws in design well. user submits login credentials (username & password) web server. web server sends call api. api looks creds., if good, jwt auth token generated , returned web server token stored in php session variable. token never made public. each call web server makes api sends request authorization header includes token pulled session. my problem is, what's best way issue new token if 1 has expired during incoming request. api checks each request's token determine if it's valid , if it's expired. if request api foo/bar example, expecting json string in return, token has expired, expected behavior? hope makes sense. please let me know if i'm not clear enough. have not had luck researching particular scenario.

ios - Add tapGesture to tableView then can not perform tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) method -

as know, use below code can endediting searchbar's firstresponder, if there scrollview or tableview, effect different. override func touchesbegan(_ touches: set<uitouch>, event: uievent?) { super.touchesbegan(touches, with: event) self.view.endediting(true) } i add tapgesture tableview, can endediting searchbar's firstresponder. but after add tapgesture tableview, tableview's tableview(_ tableview: uitableview, didselectrowat indexpath: indexpath) function not work more. how can solve issue? addition my useful code below: let tap:uitapgesturerecognizer = uitapgesturerecognizer.init(target: self, action: #selector(taptableview)) self.tableview.addgesturerecognizer(tap) func taptableview() { self.searchbar.endediting(true) } add tapgesture on view not on tableview let tap:uitapgesturerecognizer = uitapgesturerecognizer.init(target: self, action: #selector(taptableview)) self.view.addgesturerecognizer(tap)

ruby on rails - Capybara does not waiting for ajax to finish -

i trying test signup flow using rspec , cpaybara within feature spec. signup happens via ajax , capybara doesn't wait request complete. using capybara matchers specified in documentation. if add sleep statement test succeeds let(:user) { create(:user, email: 'test@example.com', password: 'password') } scenario 'visitor can sign valid email address , password', js: true sign_up_with('name', 'test@example.com', 'password') expect(page).to have_content(i18n.t( 'devise.registrations.signed_up')) end helper method handle signup: def sign_up_with(name, email, password) visit root_path find(:xpath,"//a[text()='join']").click within("#sign_up_choices") click_on "sign email" end within("#sign_up") fill_in 'user[name]', with: name fill_in 'user[email]', with: email fill_in 'user[password]', with: password click_button...

How to know about what authentication method a wcf service from wsdl -

i consuming wcf service, have wsdl me. trying consume getting 401 (authorization error). is possible know authentication method service supports wsdl have , if not how can authenticate against service? in wsdl see following binding <wsdl:binding name="webcontractorsoap12" type="tns:webcontractorsoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="callwebcontractor"> does mean supports transport level security, i.e. https , doesn't need username password authentication? <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="https://www.ramm.co.nz/webservices/6.1webcontractor" xmlns:s="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/...

linux - How to get gsettings scheme string from another user, trough javascript in gnome -

i wish know way pull gsettings user. example path background image, stored in org.gnome.desktop.background picture-uri. with shell command, write: gsettings org.gnome.desktop.background picture-uri or sudo -u taylorswift -b gsettings org.gnome.desktop.background picture-uri and in javascript with: const background_schema = 'org.gnome.desktop.background'; let background = new gio.settings({ schema: background_schema }); let location = background.get_string(picture_uri_key); ...but draw current active user. want act.user.get_icon_file() does, provided accountservice , stored in user file, have get_background_file() instead. i know ubuntu’s unity stores background path both in gsettings , in user file, , draws login screen backgrounds. tried searching how did trough source code, couldn’t find anything. may have looked in wrong sources, ones managed find, on own. sorry bad english. hope provided information needed. regards.

c# - Fastest method to remove Empty rows and Columns From Excel Files using Interop -

Image
i have lot of excel files contains data , contains empty rows , empty columns. shown bellow i trying remove empty rows , columns excel using interop. create simple winform application , used following code , works fine. dim lstfiles new list(of string) lstfiles.addrange(io.directory.getfiles(m_strfolderpath, "*.xls", io.searchoption.alldirectories)) dim m_xlapp = new excel.application dim m_xlwrkbs excel.workbooks = m_xlapp.workbooks dim m_xlwrkb excel.workbook each strfile string in lstfiles m_xlwrkb = m_xlwrkbs.open(strfile) dim m_xlwrksheet excel.worksheet = m_xlwrkb.worksheets(1) dim introw integer = 1 while introw <= m_xlwrksheet.usedrange.rows.count if m_xlapp.worksheetfunction.counta(m_xlwrksheet.cells(introw, 1).entirerow) = 0 m_xlwrksheet.cells(introw, 1).entirerow.delete(excel.xldeleteshiftdirection.xlshiftup) else introw += 1 end if end while dim intcol integer = 1 while i...

How to access the params in controller ember.js -

this router.js code. this.route('contact',{'path': '/contact/:chat_id'}); and route.js code. model(params) { return this.store.findrecord("chat", params.chat_id) }, and controller.js code , can use this. shows error null value please me. how use params in controller recordchat: function() { var chat = this.get(params.chat_id) ember.rsvp.hash({ offer_id: chat, }) } in route.js, need call setupcontroller function this: setupcontroller(controller, model) { this._super(...arguments); controller.set('chat', model); } now have access in controller calling: recordchat() { const chat = this.get('chat'); // if don't call setupcontroller function, do: // const chat = this.get('model') or this.get('model.id') if want id } update: see working twiddle here