Device Code Activation screen classes

Device Code Activation screen class

The Device Code Activation screen class provides methods associated with the device-code-activation screen. This screen is displayed when a user needs to enter a code on their device to activate it.

Import and instantiate the Device Code Activation screen class:

import DeviceCodeActivation from '@auth0/auth0-acul-js/device-code-activation';
const deviceCodeActivationManager = new DeviceCodeActivation();

// SDK Properties return a string, number or boolean
// ex. "login-id"
deviceCodeActivationManager.screen.name;

// SDK Methods return an array
deviceCodeActivationManager.continue({
  code: 'HXNL-XWMT',
});

Was this helpful?

/

Properties

The Device Code Activation screen class properties are:

interface branding {
  settings: null | BrandingSettings;
  themes: null | BrandingThemes;
}

interface BrandingSettings {
  colors?: {
    pageBackground?: string | {
      angleDeg: number;
      end: string;
      start: string;
      type: string;
    };
    primary?: string;
  };
  faviconUrl?: string;
  font?: {url: string;};
  logoUrl?: string;
}

interface BrandingThemes {
  default: {
    borders: Record<string, string | number | boolean>;
    colors: Record<string, string>;
    displayName: string;
    fonts: Record<string, string | boolean | object>;
    pageBackground: Record<string, string>;
    widget: Record<string, string | number>;
  };
}

Was this helpful?

/

Methods

The Device Code Activation screen class method is:

continue( options ?)

This method continues with the device code activation flow.

import DeviceCodeActivation from '@auth0/auth0-acul-js/device-code-activation';
const deviceCodeActivationManager = new DeviceCodeActivation();

await deviceCodeActivationManager.continue({
  code: '123456',
});

Was this helpful?

/

Parameter                  Type Required Description
code string Yes The code entered by the user.

Device Code Activation Allowed screen class

The Device Code Activation screen class provides methods associated with the device-code-activation-allowed screen. This screen is displayed when the device code activation is allowed.

Import and instantiate the Device Code Activation Allowed screen class:

import DeviceCodeActivationAllowed from '@auth0/auth0-acul-js/device-code-activation-allowed';
const deviceCodeActivationAllowedManager = new DeviceCodeActivationAllowed();

Was this helpful?

/

Properties

The Device Code Activation Allowed screen class properties are:

interface branding {
  settings: null | BrandingSettings;
  themes: null | BrandingThemes;
}

interface BrandingSettings {
  colors?: {
    pageBackground?: string | {
      angleDeg: number;
      end: string;
      start: string;
      type: string;
    };
    primary?: string;
  };
  faviconUrl?: string;
  font?: {url: string;};
  logoUrl?: string;
}

interface BrandingThemes {
  default: {
    borders: Record<string, string | number | boolean>;
    colors: Record<string, string>;
    displayName: string;
    fonts: Record<string, string | boolean | object>;
    pageBackground: Record<string, string>;
    widget: Record<string, string | number>;
  };
}

Was this helpful?

/

Device Code Activation Denied screen class

The Device Code Activation screen class provides methods associated with the device-code-activation-denied screen. This screen is displayed when the device code activation is denied.

Import and instantiate the Device Code Activation Denied screen class:

import DeviceCodeActivationDenied from '@auth0/auth0-acul-js/device-code-activation-denied';
const deviceCodeActivationDeniedManager = new DeviceCodeActivationDenied();

Was this helpful?

/

Properties

The Device Code Activation Denied screen class properties are:

interface branding {
  settings: null | BrandingSettings;
  themes: null | BrandingThemes;
}

interface BrandingSettings {
  colors?: {
    pageBackground?: string | {
      angleDeg: number;
      end: string;
      start: string;
      type: string;
    };
    primary?: string;
  };
  faviconUrl?: string;
  font?: {url: string;};
  logoUrl?: string;
}

interface BrandingThemes {
  default: {
    borders: Record<string, string | number | boolean>;
    colors: Record<string, string>;
    displayName: string;
    fonts: Record<string, string | boolean | object>;
    pageBackground: Record<string, string>;
    widget: Record<string, string | number>;
  };
}

Was this helpful?

/

Device Code Confirmation screen class

The Device Code Confirmation screen class provides methods associated with the device-code-confirmation screen. This screen is displayed when a user needs to confirm the device code.

Import and instantiate the Device Code Confirmation screen class:

import DeviceCodeConfirmation from '@auth0/auth0-acul-js/device-code-confirmation';
const deviceCodeConfirmationManager = new DeviceCodeConfirmation();

Was this helpful?

/

Properties

The Device Code Confirmation screen class properties are:

interface branding {
  settings: null | BrandingSettings;
  themes: null | BrandingThemes;
}

interface BrandingSettings {
  colors?: {
    pageBackground?: string | {
      angleDeg: number;
      end: string;
      start: string;
      type: string;
    };
    primary?: string;
  };
  faviconUrl?: string;
  font?: {url: string;};
  logoUrl?: string;
}

interface BrandingThemes {
  default: {
    borders: Record<string, string | number | boolean>;
    colors: Record<string, string>;
    displayName: string;
    fonts: Record<string, string | boolean | object>;
    pageBackground: Record<string, string>;
    widget: Record<string, string | number>;
  };
}

Was this helpful?

/

Methods

The Device Code Confirmation screen class methods are:

cancel( options ?)

This method cancels the confirmation process.

import DeviceCodeConfirmation from '@auth0/auth0-acul-js/device-code-confirmation';
const deviceCodeConfirmationManager = new DeviceCodeConfirmation();

const handleCancel = async () => {
  await deviceCodeConfirmationManager.cancel();
};

Was this helpful?

/

confirm( options ?)

This method confirms the code was successfully entered.

import DeviceCodeConfirmation from '@auth0/auth0-acul-js/device-code-confirmation';
const deviceCodeConfirmationManager = new DeviceCodeConfirmation();

const handleConfirm = async () => {
  await deviceCodeConfirmationManager.confirm();
};

Was this helpful?

/