Login with DIMO Redirect

Redirect URL Form (for non-React Applications)

If your application isn't React-based, you can still build a button in your tech stack that redirects users to one of the following URL types, depending on your flow of interest. All you need to get started is your clientId and a redirectUri that you configured in your application via the DIMO Developer Console.

Here's a list of supported entryState's:

State
Description

EMAIL_INPUT

Takes the user through a simple login flow, consider this like a DIMO SSO.

VEHICLE_MANAGER

Takes the user through a vehicle permission sharing flow after the login. Requires permissionTemplateId.

LOGOUT

Logs the user out directly.

Option 1: Login Flow Only (No Vehicle Permissions Requested)

If you want to implement a Login with DIMO flow, but don't need access to vehicle data (i.e. you just want to collect users email addresses for marketing purposes), you can use the following URL structure:

https://login.dimo.org/?clientId=<clientId>&redirectUri=<redirectUri>&entryState=EMAIL_INPUT

Please note, that if you use this method, you will not be able to make requests to any protected API endpoints, as you will not have privileged access to this users vehicles.

🔗 Check out an EXAMPLE

Options 2 & 3 require you to input a permissionTemplateId. You can read more about the available options for this under the Core Functionalities section.

Option 2: Login Flow + Permissions (Default Expiration Time)

If you're implementing a Login with DIMO flow that requires users to provide access to one or more of their vehicles, and you do not want to set a custom expiration date for how long these vehicles will be shared with you, you can use the following URL structure (the default expiration date is 100 years from the time a user shares their vehicle with you):

https://login.dimo.org/?clientId=<clientId>&redirectUri=<redirectUri>&permissionTemplateId=<templateId>&entryState=VEHICLE_MANAGER

🔗 Check out an EXAMPLE

Option 3: Login Flow + Permissions (Custom Expiration Date)

If you're implementing a Login with DIMO flow that requires users to provide access to one or more of their vehicles, and you want to set a custom expiration date for how long these vehicles will be shared with you, you can use the following URL structure:

https://login.dimo.org/?clientId=<clientId>&redirectUri=<redirectUri>&permissionTemplateId=<templateId>&entryState=VEHICLE_MANAGER&expirationDate=<date>

Note that the <date> parameter should be set in the format of: YYYY-MM-DD

🔗 Check out an EXAMPLE

Next Steps:

If you've gotten this far, you've successfully set up the DIMO redirect URL on your frontend. If you're building an application that also requires you to access vehicle data after a user has shared privileged access with you, we recommend you implement the Data SDK for the backend. When a user authenticates via the Login component, their walletAddress is returned - meaning you're ready to query the Identity API to obtain the Token IDs of the vehicles that were shared with you.

Take me to the Data SDK Docs →

Additional Optional Parameters:

Users implementing the Login with DIMO flow using the Redirect URL form also have access to additional parameters that can be included if needed.

Force Email

You can require users to share their email address with you by enforcing that they select the email sharing checkbox prior to successful sign in. Use the &forceEmail=true parameter to the end of the URL.

https://login.dimo.org/?clientId=<client_id>&redirectUri=<redirect_uri>&permissionTemplateId=<template_id>&entryState=VEHICLE_MANAGER &forceEmail=true

Vehicle Makes

You can limit your integration to only permit certain vehicle makes from connecting to your application by appending the &vehicleMakes= parameter to the end of the URL. For example, if you're building a Tesla-only application, you can format the URL like so:

https://login.dimo.org/?clientId=<client_id>&redirectUri=<redirect_uri>&permissionTemplateId=<template_id>&entryState=VEHICLE_MANAGER&vehicleMakes=Tesla

This also supports an array of vehicles, such as: &vehicleMakes=['hyundai', 'lexus']

UTM Parameters

If you're running campaigns and need to add UTM parameters to your Login with DIMO URL, you can append ?utmName=anything to the end of your URL, like so:

https://login.dimo.org/?clientId=<client_id>&redirectUri=<redirect_uri>&permissionTemplateId=<template_id>&entryState=VEHICLE_MANAGER&utm=dimo

Once a user goes through the login flow, they would be redirected to your redirectUri + the UTM params you've set at the end of the URL.

Log Out

To initiate logging out, you can supply the &entryState=logout to your Login URL like so:

https://login.dimo.org/?clientId=<client_id>&redirectUri=<redirect_uri>&permissionTemplateId=<template_id>&entryState=LOGOUT

This will log out the user from their current session, and they will need to re-authenticate / log back in to continue using your application.

Last updated

Was this helpful?