> For the complete documentation index, see [llms.txt](https://docs.personify.be/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.personify.be/development/customizations/accountidgenerators.md).

# AccountIdGenerators

When a account id generator is configured, an id will be generated during provisioning, according to the rules that are specified.\
This id will be stored for that specific identity within that specific target system.

During provisioning, **a view is composed**, containing all the relevant attributes of the identity within his environment, including organisation and entitlement assignments.

Attributes from that view can then be using the account id generation logic.

For example a identity with a view:

```
{
  "firstName" : "Homer",
  "lastName" : "Simpson",
  ........
}
```

Can be configured via account id generators to have a account id of '**simhom'** in a certain target system. \
If this unique id is already existing, the application will apply a correction mechanism and generate a new id until it is unique.

One generic generator implementation is available that accepts the following configuration.

## Crafting you own generator

You can create your own generator implementation by creating a new java maven project and include following dependency:

```
<dependency>
    <groupId>be.personify.iam</groupId>
    <artifactId>personify-provisioning</artifactId>
    <version>1.4.2.RELEASE</version>
</dependency>
```

This will give you the possibility of implementing the class Generator.

```java
....
import be.personify.iam.provisioning.generators.Generator;
....

public class CustomIdGenerator implements Generator {

  @Override
  public String generate(Map<String, Object> configurationAndView, int attempt) throws Exception {
  
  }

}
```

The configuration and view is the map with all the collected attributes which you can use for generating a string that has to be returned.

The integer attempt is the number of times that is tried to store a generated id.  This number can be used for finally obtaining a unique id.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.personify.be/development/customizations/accountidgenerators.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
