Skip to content

Conversation

@dylanmcreynolds
Copy link
Contributor

This PR establishes the framework for the tiled web-frontend to be able to authenticate.

This is highly experimental at this point. We want the ability to support a variety of authentication methods like HTTP Basic and Oath2. A configuration mechanism will have to be developed that lets users indicate which methods they want and, if OAuth2, information about the IdP servers being connected to.

At a high level, we want to support the following functionality:

  • Store the current refresh token in localStorage, adding it to each message by creating an axios interceptor and plugging it into the react app.
  • Create a user interface for authentication
  • Create a react context provider for updating the currently logged in user in the UI, and presenting the user with the opportunity to authenticate when appropriate.

A few details about the initial commit:

  • Changes the server to return all information about tokens (refresh, access and their expiration times) and removes the ability to redirect POST, which probably doesn't work anyway
  • Adds auth.tsx, a UI for authentication. Currently only supports username/password (HTTP Basic) but will hopefully grow the ability to support multiple OAuth2 providers through configuration
  • Adds a user.tsx which holds code related to a context provider for logged in user. This context provider will update when the user logs in/out.
  • Adds a route for login.
  • Adds an axios interceptor to client.ts. This interceptor stores token information in localStorage when the user successfully logs in, and add the current refresh token from local storage and adds to the headers of each message.

@dylanmcreynolds dylanmcreynolds marked this pull request as draft October 24, 2022 14:31
@dylanmcreynolds dylanmcreynolds force-pushed the frontend_context_provider branch from 363eaf8 to 60f263e Compare October 25, 2022 16:44
@danielballan danielballan force-pushed the frontend_context_provider branch from 935bb8d to c02109f Compare November 2, 2022 14:32
@danielballan
Copy link
Member

I rebased this on main and force-pushed.

@dylanmcreynolds dylanmcreynolds force-pushed the frontend_context_provider branch from c02109f to a96e096 Compare August 23, 2023 18:02
@danielballan
Copy link
Member

Superceded by #1214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants