Blocking functions reference

This page describes the AdditionalUserInfo and AuthCredential interfaces that are available when using Identity Platform blocking functions.

AdditionalUserInfo

interface AdditionalUserInfo {
  // The provider ID, such as saml.provider, oidc.provider, google.com,
  // facebook.com, etc.
  providerId: string;
  // Raw user info. This is the raw user info also returned in client SDK.
  profile?: any;
  // This is the Twitter screen_name.
  username?: string;
  // Whether the user is new or existing.
  // This is true for beforeCreate, false for others.
  isNewUser: boolean;
}

AuthCredential

See Supported OAuth credentials and data for more information.

interface AuthCredential {
  // All user SAML or OIDC claims. These are in plain object format but should
  // be verified and parsed from SAML response, IdP ID token, etc.
  // This is empty for all other providers.
  claims?: {[key: string]: any};
  // Optional OAuth ID token if available and enabled in the project config.
  idToken?: string;
  // Optional OAuth access token if available and enabled in the project config.
  accessToken?: string;
  // Optional OAuth refresh token if available and enabled in the project config.
  refreshToken?: string;
  // Optional OAuth expiration if available and enabled in the project config.
  expirationTime?: string;
  // Optional OAuth token secret if available and enabled in the project config.
  secret?: string;
  // eg. saml.provider, oidc.provider, google.com, facebook.com, etc.
  providerId: string;
}