-
Notifications
You must be signed in to change notification settings - Fork 2
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
Auth0: User password /email change #24
Comments
So I think this is being done in a bad way currently. I believe I currently have a token with a lifetime grant that is being loaded as an environment variable. Here is a file from a new project that does things better: https://github.com/artsmia/mia-storytelling/blob/master/server/src/auth/management.js. Basically, you should keep a token with an expiration in memory or in a file (that is .gitignored) and then before each request, check to make sure it isn't expired and then use refresh it if it is. |
(If you want to continue to use the token with the lifetime grant –– bad –– it is in the api's heroku environment variable configuration) |
Not sure if we are on the same page here... It sounds like in your first sentence you are describing what I just implemented and was asking you about... I wrote the above code... The only Auth0 tokens in the heroku config variables are the ones I just added. the only other existing one was for Spotify Based on auth0 documentation I think it IS okay to have a lifetime 'Management' token stored in .env, but ONLY for our API. This because we need the Management token to procure user-specific client-grant tokens (which are only good for 24hrs). I'm asking for help using the lifetime token to procure the short term client-grant token. Haven't checked out your link yet but - Will check out your link tomorrow |
Oh, ok. I guess I didn't exactly understand. Yeah we can talk about this today. |
{ |
There is an insane amount of documentation regarding setting up management/server/client APIS for auth0.
The BT AuthService is probably the most difficult code for me to follow, but as far as I can tell it doesnt seem to be able to be easily modified to allow for the authorization to change user passwords.
Just wanted to check to make sure you don't know of anything already in place that will help me.
So far i have established the bt-api as a resource server.
It seems I am supposed to get temporary client-grants with bt-api using the Bearer token I generated, and provide those grants to the BT App.
Here's a few things I wrote. the first function will actually change passwords, but apparently you are not supposed to do it directly with this method.
The second one is what successfully established the API as a resource server, and the third one returns "unauthorized" when I try to get a client grant.
Any advice in general for approaching this problem?
The text was updated successfully, but these errors were encountered: