Giter VIP home page Giter VIP logo

Comments (2)

mundanelunacy avatar mundanelunacy commented on August 20, 2024

Hi. Submitted a PR for review.

The additional code does the following:

  1. Moved the state code out of AuthContext and into the useStorage hook
  2. Added useCookieStorage to Hooks.tsx that mirrors functionality of useBrowserStorage
  3. If config.storage==='cookie' then useStorage uses the state for useBrowserStorage

Optionally, config.baseDomain can be set to manually set the cookie domain.

from react-oauth2-pkce.

soofstad avatar soofstad commented on August 20, 2024

Hi,
The library will not adopt cookie support at this point.
A few reasons:

  1. It's a non-recommended way of storing tokens (https://datatracker.ietf.org/doc/html/draft-ietf-oauth-browser-based-apps-14#section-9.1)
  2. It's a very uncommon for modern OAuth2 servers to use Cookies to send back tokens (do you have any examples?)
  3. Cross domain/subdomain tokens kind of defeats the purpose with OAuth2. Each application should have a token that is scoped to exactly that application only. Logging in and getting new tokens for each app should not be a big hurdle as it's common to have Cookies to authenticate towards the SSO auth-server.

Only reason to implement this would be to support some rare, old?, authentication providers, who are not following best practices. Which I'm not inclined to do.
I'd rather have this library support only recommended methods and pattern.

from react-oauth2-pkce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.