K
Kinde2w ago
Dave

Pass custom parameters through authUrlParams

I have a multi-tenant/multi-app application. I'm trying to pass a custom parameter in authUrlParams to then access in the token as a custom claim. How?
Code:- <LoginLink authUrlParams={{ mz_application_id: "123" }}>Sign in</LoginLink> I've created a custom property for applications and marked it as public. The property passed in the token is null. I do receive a value if I set it through the UI, but this is not going to scale. Would love some guidance. Thx.
4 Replies
Ages
Ages2w ago
Hi @Dave , To include a custom parameter like mz_application_id during authentication, you can pass it via the authUrlParams prop in the LoginLink component, as you've done:
<LoginLink authUrlParams={{ mz_application_id: "123" }}>Sign in</LoginLink>
However, to have this parameter reflected as a custom claim in the token, you'll need to ensure that the custom property is properly configured in your Kinde dashboard: Define the Custom Property: - Navigate to your Kinde dashboard. - Go to the Properties section. - Create a new property named mz_application_id and mark it as public. Map the Custom Property: - Ensure that the custom property is mapped correctly to the user's profile or session. - This mapping allows the property to be included in the token as a custom claim. For more detailed guidance on managing properties and adding them to tokens, please refer to Kinde's documentation: https://docs.kinde.com/properties/about-properties If you've already set up the custom property and it's still returning null in the token, please ensure that the property is being correctly assigned during the authentication process. If the issue persists, feel free to provide more details, and we'll be happy to assist further
Kinde docs
About properties
Our developer tools provide everything you need to get started with Kinde.
Dave
DaveOP2w ago
Hi Ages You said "If you've already set up the custom property and it's still returning null in the token, please ensure that the property is being correctly assigned during the authentication process.". I've created a mz_application_id property in Settings. In the application I've customised the token and added the property as an "application" scoped type. I see mz_application_id passed in the token as null. If I go into the Kinde Manager Desktop and explicitly assign a value, it appears in the token. The issue I'm having is the value passed in <LoginLink> is not mapping to the property but I don't see how to configure this any more than I have. Thanks, Dave
Ages
Ages7d ago
Hi @Dave Thanks for the details. It looks like the mz_application_id isn't being passed correctly through the authUrlParams in <LoginLink>. Here's how to ensure it's included in the token: - Ensure mz_application_id is created and marked as public in Kinde. - Map it correctly in the token customization settings to include it as a custom claim. - Use authUrlParams in the <LoginLink> component:
<LoginLink authUrlParams={{ mz_application_id: "123" }}>Sign in</LoginLink>
- Review token customization settings and use developer tools to check if mz_application_id is correctly included. - If using React, Kinde's SDK allows passing custom parameters:
import { useKindeAuth } from '@kinde-oss/kinde-react'; function SignIn() { const { login } = useKindeAuth(); login({ authUrlParams: { mz_application_id: "123" } }); return <button onClick={handleLogin}>Sign in</button>; }
For more details, refer to https://docs.kinde.com/properties/work-with-properties/properties-in-tokens/ If the issue persists, let us know, and we’ll assist further
Kinde docs
Add and manage properties in tokens
Our developer tools provide everything you need to get started with Kinde.
Ages
Ages2d ago
Hi @Dave , Just checking in—are you still experiencing this issue? Have you had a chance to try the suggested steps? If you have any questions or need further assistance, let us know. Otherwise, we’ll go ahead and close this query for now.

Did you find this page helpful?