RaynorUE / snich

Application for code work on a ServiceNow Instance
22 stars 4 forks source link

Enable oAuth using Authorization Code Grant Flow #153

Open RaynorUE opened 4 years ago

RaynorUE commented 10 months ago

This has been largely completed, but has some bugs to work out on it. I believe with "Refresh token" expiration, and also access token expiration. Right now it just dies, where it should re-launch the OAuth exchange when it detects that upon using other SNICH Commands.

Similar, if using basic auth, the system should re-ask for credentials..

RaynorUE commented 2 months ago

Re-wrote the oauth code entirely so it no longer uses a web-server internally, and instead uses VSCodes URI Management. Still need to solve the bugs with the expired refresh tokens, etc.

RaynorUE commented 2 months ago

Tests are looking good. Was able to verify that an expired access token regardless if expiration happens naturally or the access token is force-expired on SN Side, will attempt to use refresh token to get a new access token, and if that fails will launch automatically to "Re-authorize" (The "Allow" page).

NOTE: Pop-up window/tab does not auto-close. This is because it's opening a VSCode URL and not re-directing you "back to an app in a webpage". you will need to close the page afterwards.

RaynorUE commented 1 month ago

Need to update the ICON URL