Closed angelo-v closed 2 years ago
The links look interesting!
chrome.identity.launchWebAuthFlow(
{
url: 'https://solidweb.me/idp/auth?client_id=<client-id>&redirect_uri=https://<app-id>.chromiumapp.org/&scope=openid&response_type=code&response_mode=query&nonce=<nonce>',
interactive: true,
},
(...args) => {
console.log('auth callback', args);
}
);
Proof of concept of the chrome.identity.launchWebAuthFlow
-based auth flow is in https://github.com/codecentric/web-clip/pull/12
Regarding message size limits https://stackoverflow.com/a/31928402
accessing private resources works from options page
accessing private resources works from background script
Origin: chrome-extension://<app-id>
I would personally stick to having the UI within the content page, since this looks nicer and is more flexible than the extension popup. The login and data processing and interaction with the pod can move to the background script and be triggered by a message.
obsolete, since CORS is possible
The session lives in the background script and stays active until the script is reloaded somehow, e.g. when browser is restarted, or extension is reloaded.
Yes, the session can be re-used in multiple tabs 🎉
Not tested yet, but I would guess we just need to re-login and it is save to leave this as a known unknown so far. A token from solidweb.me is valid 1 hour.
The inrupt authn library does not provide a refresh token, so it is at least not straight forword. Could be a follow-up improvement, even without refresh the login experience will be already much better with the described measures.
Explore how to login via chrome extension instead of the webpage domain, so that the user does not have to give permission to each and every site he or she clips
https://stackoverflow.com/questions/35770897/how-do-chromiumapp-org-extension-redirects-work-for-google-chrome
https://developer.chrome.com/docs/extensions/reference/identity/#method-launchWebAuthFlow