https://supertokens.com/ logo
Docs
Join the conversationJoin Discord
Channels
community
contributing
general
github-activity
info
introductions
new-releases
random
security
support-questions
welcome-0xdelusion
welcome-aj-ya
welcome-aleksandrc
welcome-alpinjs
welcome-amberlamps1
welcome-andrew-rodriguez
welcome-ankit-choudhary
welcome-anthony-stod-custodio
welcome-call-in
welcome-chwalbox
welcome-claybiokiller
welcome-co7e
welcome-cosmoecwsa
welcome-devdag
welcome-dinso
welcome-drebotelho
welcome-elio
welcome-ernest
welcome-foxbarrington
welcome-fromscratch
welcome-galto4ir
welcome-goetzum
welcome-hay-kot
welcome-himanshu-kukreja
welcome-hossambarakat
welcome-ichikawakazuto
welcome-jahir9991
welcome-jamesl
welcome-jerry123424
welcome-john-oliver
welcome-jonas-alexanderson
welcome-jxyz
welcome-kelvinwop
welcome-kraz
welcome-lancekey
welcome-leoo
welcome-lukeacollins
welcome-m-j-mon
welcome-malik-khoja
welcome-marco
welcome-mardadi
welcome-meshguy
welcome-metamorph
welcome-mike-tectu
welcome-mirzok
welcome-mozomig
welcome-naberyou66_
welcome-nacer
welcome-namratha
welcome-naveenkumar
welcome-nightlight
welcome-nischith
welcome-notankit
welcome-olawumi
welcome-pavan-kumar-reddy-n
welcome-pineappaul
welcome-poothebear
welcome-rick
welcome-samuel-qosenergy
welcome-samuelstroschein
welcome-shubhamgoel23
welcome-shubhamkaushal
welcome-sidebar
welcome-surajsli
welcome-suyash_
welcome-syntaxerror
welcome-tauno
welcome-tauno
welcome-tawnoz
welcome-teclali
welcome-tls
welcome-turbosepp
welcome-vikram_shadow
welcome-yann
Powered by Linen
support-questions
  • r

    rp

    06/11/2021, 7:45 AM
    though MDN says it's not "strictly deprecated (as in "removed from the Web standards")"
  • r

    rp

    06/11/2021, 7:45 AM
    so maybe it's OK to use..
  • u

    user

    06/11/2021, 7:52 AM
    I found something, look at the main question and answers: https://stackoverflow.com/questions/30631927/converting-to-base64-in-javascript-without-deprecated-escape-call/31412163#31412163
  • u

    user

    06/11/2021, 7:53 AM
    Taking them into consideration I believe that we can use escape πŸ™‚
  • r

    rp

    06/11/2021, 7:55 AM
    Will make the change and add some tests for this and release the new version.
  • u

    user

    06/11/2021, 7:55 AM
    Great! Thanks
  • r

    rp

    06/11/2021, 8:38 AM
    @User , I have released version 7.2.1 of supertokens-website which contains the fix. Please use that
  • u

    user

    06/11/2021, 10:53 AM
    Thanks @User ! I have to adjust all dependencies now because I had to upgrade also supertokens-auth-react package, because without it it didn't work :/
  • r

    rp

    06/11/2021, 11:46 AM
    You would just need to delete node modules abs package.json files, and then resin stall node modules. That should fetch the latest version
  • r

    rp

    06/11/2021, 11:47 AM
    Unless you are using an older version of supertokens-auth-react. You can tell me which one and I can update the older version of supertokens-website too
  • u

    user

    06/11/2021, 11:50 AM
    I had:
    "supertokens-auth-react": "^0.8.0",
       "supertokens-website": "^5.1.0",
  • u

    user

    06/11/2021, 11:51 AM
    And I have upgraded supertokens-website to 7.2.1
  • u

    user

    06/11/2021, 11:51 AM
    Could you update supertokens-website to 7.2.1 inside supertokens-auth-react?
  • u

    user

    06/11/2021, 11:52 AM
    It would be great if I don't have to upgrade it now, because I will be forced to update the backed also πŸ™‚
  • u

    user

    06/11/2021, 11:55 AM
    To sum things up would it work correctly I have on the backend: "supertokens-node": "^4.3.3" and on the frontend : "supertokens-auth-react": "^0.8.0" "supertokens-website": "^7.2.1" ?
  • r

    rp

    06/11/2021, 12:03 PM
    @User , i'll make the fix for supertokens-website
    5.1.0
    . This way, you won't have to upgrade anything and just redownload node modules.
  • u

    user

    06/11/2021, 12:06 PM
    Great! Thank you!
  • r

    rp

    06/11/2021, 12:32 PM
    @User , i have updated supertokens-website (new version is
    5.1.1
    ) to include the fix. You should now just have to delete node_modules, remove package-lock.json and reinstall node modules.
  • r

    rp

    06/11/2021, 12:32 PM
    Also, the fix is only applied to v5.1.1 and then >= 7.2.1. So in case you want to update to a later version of auth-react, you should keep this in mind.
  • u

    user

    06/11/2021, 12:41 PM
    It works correctly now πŸ™‚ Thank you very much πŸ™‚
  • o

    Orszi

    06/12/2021, 6:07 PM
    Hi. I’m using SuperTokens in my project. Currently I have a NodeJS backend which connects to the SuperTokens auth core (I use session and emaipassword recipes). In addition I have a React app talking with the backend (with custom forms). Now I need to add another frontend react app (other domain). I want to have a group of new users who can only log in to the new app (they should not be able to log in to the current app). Have you got any suggestions how can I handle this situation with supertokens? I was thinking about creating user roles. How could I then add info about which app is the user logging in from? And also is it possible to reject the log in when the user does not have a certain role (without creating a custom endpoint)?
  • r

    rp

    06/13/2021, 4:11 AM
    hey @User > I want to have a group of new users who can only log in to the new app (they should not be able to log in to the current app). How are you going to prevent these users from logging into the previous app? By detecting their email used and preventing them from signing up / logging in? > How could I then add info about which app is the user logging in from? You can associate a role to the user once they log in (based on their userID. See this page: https://supertokens.io/docs/emailpassword/common-customizations/user-roles/assigning-users-roles > And also is it possible to reject the log in when the user does not have a certain role Not as of now, but in a few days, we will make a new release that will let you do this very easily πŸ™‚
  • s

    seniorquico

    06/13/2021, 3:21 PM
    Out of curiosity... Why do the tokens use custom claim names instead of the well-known/existing claim names? I'm thinking, in particular, of
    sub
    ,
    exp
    , and
    iat
    (from RFC 7519) and
    sid
    (OIDC).
    json
    {
      "sessionHandle": "0d...",
      "userId": "97d...",
      "refreshTokenHash1": "550...",
      "userData": {},
      "expiryTime": 1623598349546,
      "timeCreated": 1623594749546,
      "lmrt": 1623594749546
    }
  • r

    rp

    06/13/2021, 4:54 PM
    @seniorquico cause the access token isn’t meant to be used like a typical JWT is meant to be used. A typical JWT is meant to let third party systems be able to verify the contents of the JWTs in a stateless manner. Whereas, our access tokens are strictly meant for session management between your frontend and backend only. No third party system involved.
  • r

    rp

    06/13/2021, 4:55 PM
    As such, we merely borrow principles of a JWT (signing and stateless verification). You can think of them as signed payload instead of a typical JWT
  • r

    rp

    06/13/2021, 4:57 PM
    An alternate to this would be to use a random string that points to the same payload (in a db). But this would require a db query for each API call.. so to prevent that latency, we used the stateless verification approach.
  • s

    seniorquico

    06/13/2021, 5:12 PM
    ok, i get the idea that they should be treated as opaque structures and delegated to SuperTokens for parsing/validation. however, i'm currently looking into using SuperTokens in a C# environment that doesn't yet have an official SDK, and, as such, i'm looking at needing to parse and validate the JWT. there are existing, well-tested libraries that parse and validate JWTs. however, i'm running into problems using them with SuperTokens out of the box. RFC 7519 calls for base64url encoding, but SuperTokens appears to be using the regular base64 encoding. and with respect to the claims, i'll need to recreate all of the validation routines due to the custom claim names. from the RFC: > they provide a starting point for a set of useful, interoperable claims i just find it curious that you decided to explicitly not use RFC 7519 with base64url encoding and the well-known, interoperable claim names.
  • r

    rp

    06/13/2021, 5:20 PM
    It was a very conscious decision on our end to not follow the JWT spec here.. cause if we did, we thought it would be very easy for people to misuse the access token as a JWT and send it to third party services (like Hasura which uses JWTs for auth)...
  • s

    seniorquico

    06/13/2021, 5:21 PM
    fair enough. thanks for the info!
  • s

    sycured

    06/13/2021, 5:33 PM
    Wow, I looked for the same thing so thank you for the information. Do you use a generator to build your sdk? Because, it'll be very easy to build a C# or Rust (my case) to use Supertokens more quickly. For my MVP, I moved to fastapi because no sdk for rust. Have you an ETA about having full functionalities with sdk for fastapi? Regards
Powered by Linen
Title
s

sycured

06/13/2021, 5:33 PM
Wow, I looked for the same thing so thank you for the information. Do you use a generator to build your sdk? Because, it'll be very easy to build a C# or Rust (my case) to use Supertokens more quickly. For my MVP, I moved to fastapi because no sdk for rust. Have you an ETA about having full functionalities with sdk for fastapi? Regards
View count: 3