search

Welcome, User

menu
CAL Examples - TypeScript

Features

Learn CAL (Chevron Authentication Library) implementation in TypeScript applications.

This interactive example demonstrates how to integrate CAL into your TypeScript projects. Explore the complete authentication workflow:

  • 🔧 Initialize and configure CAL library
  • 👤 Authenticate users and manage claims
  • 📊 Retrieve data from Microsoft Graph API
  • 🌐 Access secured APIs with proper tokens
  • 🔐 Implement role-based authorization

Use the sidebar navigation to jump to specific sections, or scroll through all examples to see the complete CAL implementation flow.

take the tour

âš™ī¸ CAL Configuration Guide

Initialize and configure the CAL library. This is the foundation for all CAL operations and should be done first.

  • Get Configuration
  • Library Version
new Cal.CalClient(CALConfig)

Initialize the CAL library with configuration settings. See CAL Instance Setup for details.

CAL library initializing automatically...

👤 Using the CvxClaimsPrincipal

Learn how to authenticate users and access their claims. This covers the complete authentication flow and user identity.

  • Check Auth Status
  • Get Claims
  • Sign Out
isUserSignedIn()

Check if user is currently authenticated. See Authentication Status Check for details.

CAL is ready. Check authentication status when needed...

📊 Retrieving Data from Microsoft Graph

Access user profile data and organizational information from Microsoft Graph API.

â„šī¸ Note: The role-related methods below use Microsoft Graph API to retrieve app role assignments. These work with User.Read and User.Read.All permissions.
  • Check Group Membership
  • Get Roles
  • Roles by Resource
  • Roles by Resources
getUserPropertiesFromMsGraph(properties)

Retrieve current user's profile information from Microsoft Graph. See Basic User Properties Retrieval for details

No profile data yet...

🌐 Retrieving Data from an API

Learn how to get access tokens and call secured APIs. This is essential for accessing protected resources.

  • ID Token Claims
  • Token from Cache
  • Clear Cache
getAADToken(scopes)

Retrieve the current user's access token for API calls. See Token Acquisition Methods for details.

No token retrieved yet...