Yvens
Yvens
Explore posts from servers
KKinde
Created by Yvens on 9/14/2024 in #💻┃support
add-urls-to-kinde script
After creating a M2M application and setting the client_id and client_secret for my nextjs app. It seems that I can't get the addCallBackUrlToKinde function to work. I also added the scopes authorization related to application_redirect_uris to m2m application: Thank you for your help !
async function addCallbackUrlToKinde (token) {
try {
const response = await fetch(
`${process.env.KINDE_ISSUER_URL}/api/v1/applications/${process.env.KINDE_M2M_CLIENT_ID}/auth_redirect_urls`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
urls: [`https://${process.env.VERCEL_URL}/api/auth/kinde_callback`]
})
}
)

if (!response.ok) {
console.log('response:', response)
throw new Error(
`Failed to add callback URL to Kinde: ${response.statusText}`
)
}

const responseData = await response.json()
console.log(
`SUCCESS: Callback URL added to Kinde: ${process.env.VERCEL_URL}/api/auth/kinde_callback`,
responseData
)
} catch (error) {
console.log('error:', error)
console.error('Failed to add callback URL to Kinde', error)
throw error
}
};
async function addCallbackUrlToKinde (token) {
try {
const response = await fetch(
`${process.env.KINDE_ISSUER_URL}/api/v1/applications/${process.env.KINDE_M2M_CLIENT_ID}/auth_redirect_urls`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
urls: [`https://${process.env.VERCEL_URL}/api/auth/kinde_callback`]
})
}
)

if (!response.ok) {
console.log('response:', response)
throw new Error(
`Failed to add callback URL to Kinde: ${response.statusText}`
)
}

const responseData = await response.json()
console.log(
`SUCCESS: Callback URL added to Kinde: ${process.env.VERCEL_URL}/api/auth/kinde_callback`,
responseData
)
} catch (error) {
console.log('error:', error)
console.error('Failed to add callback URL to Kinde', error)
throw error
}
};
5 replies
KKinde
Created by Yvens on 4/25/2024 in #💻┃support
Kinde Management api
Did I misunderstood something here ? I'm trying to create a user with the role "user", but Kinde does not seem to pick it up. It does not reflect on the dashboard. The key of the role I created is "user"
const apiClient = await createKindeManagementAPIClient();
const addedToOrzanisation = await apiClient.organizationsApi.addOrganizationUsers({
orgCode: organization.orgCode,
addOrganizationUsersRequest: { users: [{ id: createdUser.id, roles: ["user"] }] }
});
const apiClient = await createKindeManagementAPIClient();
const addedToOrzanisation = await apiClient.organizationsApi.addOrganizationUsers({
orgCode: organization.orgCode,
addOrganizationUsersRequest: { users: [{ id: createdUser.id, roles: ["user"] }] }
});
Thank you
9 replies
KKinde
Created by Yvens on 4/22/2024 in #💻┃support
What would be the most secure way to create invitation link for users to join an organizations ?
I'm using resend to send the invitation link (Nextjs app router SDK). The link should be created with the org_code. I would like to make it one-time use. Let me know if you have any other security concerns I should think about. I know that I may need to implement the thing or a part of it myself. I want to be sure that there isn't an other way already provided by Kinde. Thank you
5 replies
KKinde
Created by Yvens on 2/20/2024 in #💻┃support
Testing protected pages in cypress (e2E)
Hello, Is there a way to bypass the authentication process to e2e test pages and flows that are protected ? I'm new to e2e testing and I see everywhere else that there are mechanism to mock the auth or authenticate the user programmatically. Maybe I'm missing something. I'm using The app router SDK.
17 replies
PD🧩 Plasmo Developers
Created by Yvens on 7/23/2023 in #👾extension
Using context between sidepanel tabs
Is it possible to use a context with a firebase hook to handle authentication between multiple sidepanel tabs ? Because I'd like to be able to navigate between multiple sidepanels for differents features in my extensions.
2 replies
PD🧩 Plasmo Developers
Created by Yvens on 7/13/2023 in #👟framework
Login with firebase using google auth
I'm trying to log in my users using the google login but I always have this error after following the tutorial about firebase & google auth: "OAuth2 request failed: Service responded with error: 'bad client id: client_id_from_gcp
2 replies