Update custom auth generator to generate auth client
See original GitHub issueWhat?
Currently the custom auth generator just changes App.tsx/js with the Auth provider, and generate src/lib/auth for the API side
However, its missing a crucial piece - generating the “scaffold” or an unimplemented custom auth client for the web side
Why?
Often when you create a custom auth, you’re looking for more control over the methods used to login/signup/logout - even if its a provider that we officially support.
Things to consider
- Generate AuthProvider for web
- Generate AuthClient to pass to the AuthProvider
- Modify App{.tsx/js} (and maybe other relevant parts of web) to use these custom client and provider
- Make sure
useAuth
uses custom client (or generate a customUseAuth hook) - Do we need to update the types for AuthClient to be more flexible with types? I don’t think so, but worth checking
- We don’t want to encourage “all sorts” of auth at this stage. The limitation around the custom auth client should be that it uses a bearer token in requests, and sets the auth-provider to custom, the same way all the other auth providers do.
- Provide documentation on how all this works, including if we want a custom serverless function to do the auth functionality for us (kind of like how dbAuth does)
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
[GO][Question] Custom auth method · Issue #7390
I am trying to create a custom auth method for Go client of an application. The auth method requires either to generate a...
Read more >Create Custom Tokens | Firebase Authentication - Google
Create custom tokens using the Firebase Admin SDK. Reserved custom token names. Sign in using custom tokens on clients; Create custom tokens using...
Read more >OAuth 2.0 for Client-side Web Applications | Authorization
Go to the Credentials page. · Click Create credentials > OAuth client ID. · Select the Web application application type. · Complete the...
Read more >How to Use Cognito Pre-Token Generation trigger ...
This Lambda trigger allows you to customize an identity token before it is generated. You can use this trigger to add new claims,...
Read more >How to get an access token with Authorization Code Grant
This topic demonstrates how to manually generate an access token using Authorization Code Grant authentication or with a refresh token. In the Authorization...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry, I haven’t had a chance to really look into this or the related issue. I’m happy if anyone else wants to take a crack, otherwise I’ll try to come back to it in a few weeks time.
Also, I think this issue dovetails nicely with https://github.com/redwoodjs/redwood/issues/1585