Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user authentication #25

Open
5 tasks
nickdos opened this issue Sep 9, 2022 · 3 comments
Open
5 tasks

Add user authentication #25

nickdos opened this issue Sep 9, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request front-end React

Comments

@nickdos
Copy link
Collaborator

nickdos commented Sep 9, 2022

Jack has a sample React project that uses the ALA OIDC authentication service:

https://github.com/AtlasOfLivingAustralia/ala-oidc-react

Basically, all that needs to be done to implement it is: Add AuthProvider wrapper to the app component (see here, optionally load the clientID etc from config), and then just use the useAuth hook and call the signIn / signOut functions (see here)

Could also write your own API provider which is a child component of the Auth provider, and make it call the useAuth hook and automagically add the Bearer token to all requires

You define the actual context values in the Producer component. You can use the useContext hook & pass in the context value to access that data from anywhere. The cheeky part is, since the producer is a react component, you can have state values and use hooks to update the context value. If you were to make an API context, you can call the useAuth hook from it's producer component & check whether the user is authenticated & retrieve the bearer token. The values you would provide to the context could be functions that make API calls, generated by the Producer component with the bearer token automatically included in the header. Example of it here.


Enhancements to authentication and user profile features

  • When logged in, show drop-down menu with avatar and initials (or similar)
    • view/edit profile
    • saved items, liked items
    • logout
  • CI Login implementation CI Login authentication #35
@nickdos nickdos self-assigned this Sep 9, 2022
@nickdos nickdos added enhancement New feature or request front-end React labels Sep 9, 2022
nickdos added a commit that referenced this issue Sep 14, 2022
Login/logout button in header - doesn't do anything yet but allows user to login via auth-test.ala.org.au.
@nickdos
Copy link
Collaborator Author

nickdos commented Sep 15, 2022

Done - PR merged.

@nickdos nickdos closed this as completed Sep 15, 2022
@nickdos nickdos reopened this Sep 28, 2022
@nickdos
Copy link
Collaborator Author

nickdos commented Sep 28, 2022

Adding some enhancements to this issue...

@nickdos
Copy link
Collaborator Author

nickdos commented Oct 4, 2022

Investigating if we should get on the test/dev server for CI logon (same as BPA/Galaxy).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request front-end React
Projects
None yet
Development

No branches or pull requests

1 participant