Using Access Manager

This guide walks you through how to use the Access Manager plugin in your application. It covers setup, configuration, and how the Auth and Identity serivces work together to handle authentication and identity management.


Typical usage


Access Manager is built to make authentication straightforward, whether you’re managing real people or system-to-system integrations. Here’s how it typically fits into your workflow.

Human access

When you’re creating the credentials for a person, you’ll usually follow these steps:

Step 1 - Check the group permissions

First, figure out what roles or permissions you want the person to have. To do so, you can list all groups available using the List Groups endpoint.


Step 2 - Create the user

Once you’ve got the right groups in mind, it’s time to create the user. To do so, use the Create a User endpoint.

  • Add them to the correct groups during creation so they get the permissions they need from day one.
Managing Users

The following endpoints are also available for you to manage the users and their access:


Step 3 - Request a token using password

The user can now authenticate using their credentials. To do so, use the Request an Access Token endpoint and use passwordas the grantType. This will return an access token they can use to access your protected APIs.


M2M access

For system-to-system (machine-to-machine) scenarios, the flow is a little different, but just as simple.

Step 1 - Create an application

Every system or service that needs to connect via M2M must have its own application. Use the Create an Application endpoint to set up access to the Lerian application your system will talk to.

💡

Application name

The name field must match one of Lerian’s predefined application names. Right now, the available options are:

  • midaz
  • plugin-fees
  • plugin-crm
  • plugin-smart-template
Managing Applications

The following endpoints are also available for you to manage the applications:

Step 2 - Request a token using client credentials

Once your application is set up, it can authenticate itself without a user. To do so, use the Request an Access Token endpoint and use client_credentialsas the grantType. This returns a token the system can use to call APIs securely.


Ending user session

If, for some reason, you need to end a user's session and revoke their active tokens, ensuring a secure and complete logout from the application, use the End User Session endpoint.