selenium - How to make ADAL.js accept an implicit token in URL without writing to localStorage first -
background: have web site uses adal.js acquire implicit token identifying user , allowing communication associated web service. per adal guidance, first thing when page loads call authorizationcontext.handlewindowcallback(); if user isn't logged in, calls authorizationcontext.login() redirect azure active directory authentication.
issue: works great actual usage, test cases using selenium, i'd not have go through separate login on every single test. since can use adal.net acquire token, seems should possible me hand token somehow adal.js in url , start off already-logged-in instead of having redirect-redirect login dance. however, adal.js doesn't seem of state url--it looks guids have been set in localstorage during login(), , if doesn't find them won't accept whatever implicit token in url, means wind going through login() anyway regardless of fact i've got valid token.
workaround: current plan modify adal.js source code behave differently when localstorage empty (as when start new (chrome) selenium instance). seems kind of hack modify source code in order support test scenario. there better way that's natively supported adal.js?
i using adaljs v1.0.14 have no objections changing versions if necessary.
Comments
Post a Comment