# Attribute definition

## Description

The attribute definition page displays all the **auto-generated user attributes**. Those attributes will be the attributes to deliver from the identity providers to the service providers depending on the defined rules.

Soffid has a default implementation for common attributes like FullName or uid, but you can modify it by creating a custom script.

## Screen overview

![](https://bookstack.soffid.com/uploads/images/gallery/2021-09/embedded-image-enety9lr.png)

## Custom attributes

- **Name**: a descriptive name.
- **ShortName**: short name to be used by SAML 2 service providers (without blanks).
- **Oid**: OID to be used by SAML 1 and SAML 2 service providers.
- **OpenID name**: OpenID name to be used by OAuth and OpenID connect service provider.
- **Radius ID**: Radius ID name.
- **Value**: an attribute value. Allows you to define a BeanShell script to determine the value of the attribute.

## Examples

Soffid IdP has a default implementation for common attributes like FullName or uid, but you can modify it by creating a custom script. You can use the custom script to define the value of an attribute.

Examples to define the value of an attribute.

#### Example 1

Return full name in upper case:

```Java
return fullName.toUpperCase();
```

#### Example 2

Send one value if an attribute is blank. Otherwise, its value:

```Java
return
    attributes{"company"} == null ||
    attributes{"company"}.isEmpty() ?
        "Soffid" :
        attributes{"company"}
```

#### Example 3

Use serverService to fech the OU attribute of the account owned by the user in the Active Directory (AD) system:

```JSON
for (account: serverService.getUserAccounts(id, "ad")) {
    return account{"attributes"}{"ou"};
}
return null;
```

## Actions

#### Attribute definition query

<table border="1" id="bkmrk-add-or-remove-column" style="width: 797px;"><tbody><tr><td style="width: 191px;">**Add new**

</td><td style="width: 606px;">Allows you to add a new attribute definition in the system. You can choose that option on the hamburger menu or clicking the add button (+).

To add a new it is necessary to fill in the required fields.

</td></tr><tr><td style="width: 191px;">**Delete**</td><td style="width: 606px;">Allows you to remove one or more Attribute definitions by selecting one or more records and next clicking the button with the subtraction symbol (-).

To perform that action, Soffid will ask you for confirmation, you could confirm or cancel the operation.

</td></tr><tr><td style="width: 191px;">**Import**</td><td style="width: 606px;">Allows you to upload a CSV file with the attribute definition to add or update attribute definition to Soffid.

First, you need to pick up a CSV file, that CSV has to contain a specific configuration. Then you need to check the content to be loaded, it is allowed to choose if you want or not to load a specific attribute. And finally, you need to select the mappings for each column of the CSV file to import the data correctly and to click the Import button.

</td></tr><tr><td style="width: 191px;">**Download CSV file**

</td><td style="width: 606px;">Allows you to download a CSV file with the basic information of all attribute definitions.

</td></tr></tbody></table>

#### Attribute definition detail

<table border="1" id="bkmrk-delete-allows-to-rem"><tbody><tr style="height: 28px;"><td style="width: 190.909px; height: 28px;">**Delete**

</td><td style="width: 605.455px; height: 28px;">Allows you to save the data of a new Attribute definition or to update the data of a specific Attribute definition. To save the data it will be mandatory to fill in the required fields.

</td></tr><tr style="height: 28px;"><td style="width: 190.909px; height: 28px;">**Save**

</td><td style="width: 605.455px; height: 28px;">Allows you to download a csv file with the basic information of the Attribute definition.

</td></tr></tbody></table>