[Typescript] Get user custom SAML attributes

Hello community,

In our project we pass some custom attributes using SAML and I’m trying to get them using the getUserById built-in function in TypeScript. I got some attributes but none of the one I’m passing during the SSO connection. Is there a way to get them maybe with a parameter or an other function or should I do my own function to have all the user informations ?

Thanks a lot.

It looks like the method only return username, email, first name and last name.

I think the only way would be as of now to write your own function where you hit this users public api to get all the info. It might be worth looking at the Palantir typescript sdk to do this.

Not sure if others have a better solution?

If you’d like to do this directly from a TypeScript function, I recommend trying out the TypeScript OSDK repository template for functions which supports calling the public API through the Platform SDK.

In the repository creation screen, the template will show up here. (Please let us know if you don’t see it and we can get it installed for you.)

In the library sidebar, you can import the version of @osdk/foundry that you’d like and then write a function that gets the attributes for the current user. (There are several other APIs in the Users category that might also be of interest to you.)

import { Client } from "@osdk/client";
import { Users } from "@osdk/foundry.admin";

async function getUserAttributes(client: Client): Promise<string> {
    const response = await Users.getCurrent(client);
    return JSON.stringify(response.attributes);
}


export default getUserAttributes;

This looks really interesting! Is this also available via the python osdk? Would you recommend user attribute evaluations for triggering functions?
Since this goes deeply into the security direction, it is probably not a good idea…

is there a way that we can compute user attributes from a pipeline and put them on the actual foundry user to be used in RV policies and here in the Ontology SDK? So far, I only know about the SAML attributes that we get from our identity provider - which are not always complete for every usecase since there are multiple systems managing user authorization…