bnln
bnln
KKinde
Created by bnln on 3/22/2024 in #💻┃support
Getting tokens failing when navigating to new page
actually this worked really well - I ended up moving my post request, where I was using the token, on to the server side, which probably is a much better place for it. Thanks again for the help and guidance. 🙏
5 replies
KKinde
Created by bnln on 3/22/2024 in #💻┃support
Getting tokens failing when navigating to new page
thanks @Daniel_Kinde - I'll try this out
5 replies
KKinde
Created by bnln on 2/5/2024 in #💻┃support
Add audience using Nuxt Module
@Daniel_Kinde thanks 🙏
12 replies
KKinde
Created by bnln on 2/5/2024 in #💻┃support
Add audience using Nuxt Module
This is the composable that I'm using in the meantime;
import { jwtVerify, createRemoteJWKSet } from "jose";

export const useClaim = async (
token: string,
claim: string
): Promise<string | undefined> => {
const authDomain = "https://<MyOrgName>.kinde.com";

try {
const JWKS = createRemoteJWKSet(new URL(`${authDomain}/.well-known/jwks`));

const { payload } = await jwtVerify(token, JWKS, {
issuer: authDomain,
});
const claimValue = payload[claim];
if (typeof claimValue === "string") return claimValue;
} catch (e) {
console.log(e);
return undefined;
}
};
import { jwtVerify, createRemoteJWKSet } from "jose";

export const useClaim = async (
token: string,
claim: string
): Promise<string | undefined> => {
const authDomain = "https://<MyOrgName>.kinde.com";

try {
const JWKS = createRemoteJWKSet(new URL(`${authDomain}/.well-known/jwks`));

const { payload } = await jwtVerify(token, JWKS, {
issuer: authDomain,
});
const claimValue = payload[claim];
if (typeof claimValue === "string") return claimValue;
} catch (e) {
console.log(e);
return undefined;
}
};
12 replies
KKinde
Created by bnln on 2/5/2024 in #💻┃support
Add audience using Nuxt Module
One "nice to have" would be a getClaim() method. I'd like to get the orgName, though I see getPermissions() returns the orgCode. Otherwise, would you recommend decoding the token and storing it with Pinia?
12 replies
KKinde
Created by bnln on 2/5/2024 in #💻┃support
Add audience using Nuxt Module
@Daniel_Kinde Actually I'm just working on the client side at the moment. My use of the management API was just an example, but essentially I just wanting to add audiences
12 replies
KKinde
Created by bnln on 2/5/2024 in #💻┃support
Add audience using Nuxt Module
Hi @Daniel_Kinde 1. Yes, I double checked to make sure that I'd enabled the API in the app. I also tried with another API as well just to make sure it was nothing specific to the Kinde management API. 2. I've set the env variable NUXT_KINDE_AUDIENCE to be the API audience. (Following a suggestion from the @Ai – Kinde ) In the token though, I only see aud: [], so I'm wondering if this has been implement for NUXT, as I couldn't find it in the docs. Thanks for the assistance!
12 replies