spicypixel
spicypixel11mo ago

Can you add claims via Actions scripts with service account tokens?

Hey all, I've been using actions v1 scripts to embed the orgId into my jwt so my applications can get some org context just from the token, is this something you can do with the service account tokens generated via the client credentials flow?
2 Replies
spicypixel
spicypixelOP11mo ago
function setOrgId(ctx, api) {
const user = ctx.v1.getUser();
api.v1.claims.setClaim("org_id", user.resourceOwner);
}
function setOrgId(ctx, api) {
const user = ctx.v1.getUser();
api.v1.claims.setClaim("org_id", user.resourceOwner);
}
worked so happy days
FFO
FFO11mo ago
Yeah, thanks for sharing!

Did you find this page helpful?