ARES for Partners
  • ARES OAuth Integration Guide
  • Reference
    • Configuring OAuth
      • Auth0 by Okta
      • Clerk
      • Supabase
      • Manual Integration
    • Configuring App to Earn Credits
      • Track Usage with Clerk
      • Track Usage with Auth0
      • Track Usage with Supabase
  • API Endpoints
Powered by GitBook
On this page
  • Step 1: In your dashboard, head over to Authentication, then to Social
  • Step 2: Click "Create connection" in the top right
  • Step 3: Scroll down to the very bottom and click "Create Custom"
  • Step 4: Fill in the following values in the fields:
  • Step 5: In the same page as step 4, configureyour client ID and client secret
  • Step 6: Also in the same page, add the fetch user profile script with the following code:
  • Step 7: Click "Create"
  • Step 8: Enable connection for your app
  • Step 9: Configure Redirect URI with ARES
  • Step 10: Now your app can access ARES API endpoints if the user signs in with ARES. Next, configure your app to track user usage to earn credits.
  1. Reference
  2. Configuring OAuth

Auth0 by Okta

Guide on how to add ARES as an OAuth sign in provider with Auth0

PreviousConfiguring OAuthNextClerk

Last updated 3 months ago

If you run into any problems, email us at admin@joinares.com or refer to the official Auth0 resource here:

Step 1: In your dashboard, head over to Authentication, then to Social

Step 2: Click "Create connection" in the top right

Step 3: Scroll down to the very bottom and click "Create Custom"

Step 4: Fill in the following values in the fields:

Name: ARES

Authorization URL: https://joinares.com/oauth

Token URL: https://oauth.joinares.com/oauth/token

Step 5: In the same page as step 4, configureyour client ID and client secret

Only certified ARES Partners have Client ID and Client Secret. If you want to become an ARES Partner, email admin@joinares.com.

Step 6: Also in the same page, add the fetch user profile script with the following code:

function fetchUserProfile(accessToken, context, callback) {
  request.get(
    {
      url: 'https://oauth.joinares.com/v1/user',
      headers: {
        'Authorization': 'Bearer ' + accessToken,
      }
    },
    (err, resp, body) => {
      if (err) {
        return callback(err);
      }
      if (resp.statusCode !== 200) {
        return callback(new Error(body));
      }
      let bodyParsed;
      try {
        bodyParsed = JSON.parse(body);
      } catch (jsonError) {
        return callback(new Error(body));
      }
      const profile = {
        user_id: bodyParsed.user.id,
        username: bodyParsed.user.name,
        email: bodyParsed.user.email
  
      };
      callback(null, profile);
    }
  );
}

Step 7: Click "Create"

Step 8: Enable connection for your app

Step 9: Configure Redirect URI with ARES

Once you have set everything up, email admin@joinares.com with your client ID and redirect URI.

If you're using an Auth0-hosted log in page, your redirect URI will look like https://dev-{your-app}.us.auth0.com/login/callback

If you're using a self-hosted log in flow, your URI will look like: https://{yourDomain}/login/callback

Each Auth0 application has different redirect URIs.

Do not deploy your ARES integration in production until we have verified your redirect URI and emailed you back confirming.

Step 10: Now your app can access ARES API endpoints if the user signs in with ARES. Next, configure your app to track user usage to earn credits.

You can do this step while waiting for us to confirm your redirect URI.

You can find your redirect URI in (must be logged in).

this page
Track Usage with Auth0
https://auth0.com/docs/authenticate/identity-providers/social-identity-providers/oauth2