question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update custom auth generator to generate auth client

See original GitHub issue

What?

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:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
doesnotexistcommented, Nov 4, 2021

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.

1reaction
doesnotexistcommented, Oct 25, 2021

Also, I think this issue dovetails nicely with https://github.com/redwoodjs/redwood/issues/1585

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found