> For the complete documentation index, see [llms.txt](https://trillo.gitbook.io/trillo-workbench/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trillo.gitbook.io/trillo-workbench/openid-connect-oidc-for-identity/onelogin-integration.md).

# OneLogin Integration

This chapter discusses steps to integrate OneLogin Identity. The registration step is described by a reference to the instruction page.

## Registering applications with OneLogin

Refer to the following page on the OneLogin website for registering a new application.

[How To Set Up Your Own OneLogin App](https://breadbutter.io/how-to-set-up-onelogin-openid-connect/)

## Writing Mapping Function

Okta function for mapping the user profile is shown below.

```
public class OktaUserProfileMapper implements Loggable, TrilloFunction {

  public Object handle(ScriptParameter scriptParameter) {

    try {
      return _handle(scriptParameter);
    } catch (Exception e) {
      log().error("Failed", e);
      return Result.getFailedResult(e.getMessage());
    }
  }

  @SuppressWarnings("unchecked")
  private Object _handle(ScriptParameter scriptParameter) {
    Map<String, Object> idpUser = (Map<String, Object>)scriptParameter.getV();
    Map<String, Object> trilloUser = mapUserProfile(idpUser);
    return trilloUser;
  }
  
  private Map<String, Object> mapUserProfile(Map<String, Object> idpUser) {
    Map<String, Object> trilloUser = new LinkedHashMap<String, Object>();
    trilloUser.put("firstName", idpUser.get("given_name"));
    trilloUser.put("lastName", idpUser.get("family_name"));
    trilloUser.put("externalId", idpUser.get("sub"));
    trilloUser.put("emailAddress", idpUser.get("email"));
    return trilloUser;
 }
}
```
