Why do i keep on getting invalid credetianls log?

My app is working well in development, i am consuming the management api, it usually logs "invalid credentials" even when i have correctly set the env variables and inited the management api with the init() method. However, when i try to run a built of my code for production, this log is the only thing i see and the management api does not respond, any advice?
7 Replies
onderay
onderay5mo ago
Sorry to hear that you cant get the Management API to work for you in Production. What Kinde SDKs are you using? Are the credentials for the API seperate from the main app credentials? More an FYI but we have API SDK now that we are slowly phasing in https://github.com/kinde-oss/management-api-js
GitHub
GitHub - kinde-oss/management-api-js: javascript package for intera...
javascript package for interacting with the Kinde Management API - kinde-oss/management-api-js
DavidF9265
DavidF9265OP5mo ago
I was trying to use it in the nextjsnserver actions (which seems fair to me)... is this behavior not really expected? first i created and consumed the init method, then i created actions for all the other methods like getOrganizations from Organization class. But when running it i got the error. What do you mean by separate credentials? i had my m2m variables well declared in the env file let me know if you want to see some of my code, i can share it with you, as well as the way i placed my envs
onderay
onderay5mo ago
Are you able to share your code for these parts? Of course, anonymize any private information, so we can see how you have things setup Separate Credentials for Management API​: make sure you have separate credentials for it. The KINDE_MANAGEMENT_CLIENT_ID and KINDE_MANAGEMENT_CLIENT_SECRET should be configured separately from your main application credentials.
DavidF9265
DavidF9265OP5mo ago
you mean those should be placed ina different env file? i have them all in the same env file I'll dm you in a couple minutes with some of my code (no worries its POC, no corporate secret code here hahaha) @Andre @ Kinde I have sent you a couple of messages sharing all my code
onderay
onderay5mo ago
Got it, we will look into it now
Peteswah
Peteswah5mo ago
This is most likely due to router.push() - if you could use a <Link> or the redirect function it should work
DavidF9265
DavidF9265OP5mo ago
thanks @Peter (Kinde) ! is this a workaround then? what is the root cause of router.push causing conflicts here? is this meant to work this way or will kinde team look for a fix?
Want results from more Discord servers?
Add your server