Step 1: Register Your Application

Before you can start implementing Rumi.ai's Auth setup, you will need a client ID. Please email [email protected] to have your app provisioned. We will provide you with a unique client ID and client secret, which are necessary for the OAuth 2.0 authorization flow.

Step 2: Set Up Redirect URI

Please include a redirect URI for your application when requesting your client ID. This is the URL where users will be redirected after they authorize your application. Ensure that the URI is protected and can handle the authorization code.

Step 3: Construct the Authorization URL

To initiate the authorization flow, construct a URL with the following parameters:

The Rumi authorization url is: https://rumi.ai/auth/login

Step 4: Redirect the User to the Authorization URL

When a user needs to authenticate, redirect them to the constructed authorization URL. The user will be prompted to approve your application's access request.

Step 5: Handle the Redirect Back to Your Application

Once the user authorizes your application, they'll be redirected back to the specified redirect URI with the authorization code and state in the query string. Verify that the state matches the one generated earlier to prevent CSRF attacks.

Step 6: Exchange the Authorization Code for an Access Token

Now that you have the authorization code, make a POST request to the token endpoint with the following parameters: