Hey, I have a website and a chrome extension. What...
# support-questions-legacy
k
Hey, I have a website and a chrome extension. What i want to do is when the user logins inside the website, he should automatically login inside the extension as well. This is a business project.
r
hey @kumar_ayush we don't have good support for chrome extension at the moment. The website login right now works using cookies attached to the api domain, im not sure if browsers allow such a case where cookies will be sent via extensions.
k
There is a feature where the cookies can be read by the extension using the background script.
r
i don;'t think httpOnly cookies will fall in that category
k
If is send the cookie somehow will be able to authenticate
r
what do you mean?
k
Hey, I got the cookies. I used the api chrome.cookies.getAll
Here is the cookies which I got when provided the discord url.
r
oh ok! but you need to get them for the api domain on which the supertokens cookies are attached
k
I will get but there was one problem, I think I might face.
Oauth 2.0 will logout the user if it detects expired tokens, what will be the fix.
r
you mean if the acess token has expired?
in that case, your backend will send back a 401, and you want to call the refresh API
k
No, it is said in auth2.0 that if someone steals your tokens and try to login from another device. It will actually logout both the user. Won't this will happen when the extension will use the token, and a new refersh and access tokens will be issed.
r
if the extension refreshes the session, the new tokens should be attached to the same API domain as the one that the website is querying (on the same browser) - so this shouldnt be an issue
k
Ok I will implement this then get back to yout.
Hey rp, the authentication works but when I close the browser the cookies are cleared.
r
what is the cookie domain?
k
@Arne can you help
cookie domain
Ok now i got it working. Actually I was reqeusting the cookie from discord.com. Now I am accessing from my own project which is hosted on netlify and uses supertokens on the backend.
27 Views