KNowledgeOnWebScale / solid-authentication-browser-extension

10 stars 1 forks source link

Replace headers before fetch instead of replacing html #2

Closed axellorreyne closed 1 year ago

axellorreyne commented 1 year ago

At this point, the extension will catch a request returning a 401 status code and attempt to make an authenticated request using the previously generated access token linked to the user's WebID on the server. If the authentication succeeds, the extension will replace all the html content in the tab returning the 401 with the html content of this authenticated response.

Instead, the extension should intercept the request before it is send if it requires authenitcation and replace this request's headers with headers that would pass authentication, the same way the Client Credential API builds authenticated fetches. This way, the webpage is only loaded once and authenticated directly.