Introduction to OrgNet

Welcome to the OrgNet documentation. OrgNet provides a complete, cloud-hosted identity and access platform, designed to be integrated in minutes.

Whether you're building a new app or adding auth to an existing one, OrgNet gives you secure, multi-tenant, and scalable identity out of the box.

Authentication Flow

Our SDKs handle the entire OAuth 2.1 flow with PKCE for you. When you call orgnet.protectPage(), here's what happens:

  1. The SDK checks for an active session.
  2. If no session exists, it redirects the user to your branded OrgNet login page.
  3. After a successful login, OrgNet redirects the user back to your application with a secure code.
  4. The SDK automatically exchanges this code for a set of tokens (Access, ID, Refresh) and establishes a session.

Example: Getting a User

Once a user is authenticated, you can get their profile from your server-side API or (for simple apps) directly in the client.

// Get the user's profile object
const user = await orgnet.getUser();

// user object contains:
// {
//   sub: "user_123xyz",
//   name: "Jane Doe",
//   email: "jane.doe@example.com",
//   org_id: "org_abc789"
// }