Authentication

Last modified by Manuel Leduc on 2024/10/23 13:50

Description

The authentication extension allows for user to authenticate as users of the current backend.

Supported Backends

  • XWiki

User

Users are proposed to log in only if the current backend supports it.

When the backend supports it, a log-in button is proposed in the left panel.

When the user is logged in, a new button is presented on the left panel, allowing users to open a modal with additional information about the current user and a logout button.

Admin

N/A

Developer

Authentication Manager

An authentication manager provides the implementation allowing to interact with the authentication of a user backend.
For instance, for the XWiki backend, the authentication works by interacting with the OIDC Provider Extension.

/**
 * Interface to implement for a given backend to allow users to authenticate.
 *
 * @since 0.11
 */

interface AuthenticationManager {
 /**
   *  Starts the authentication process.
   */

  start(): void;

 /**
   * Handle the callback.
   */

  callback(): Promise<void>;

 /**
   * Returns the currently registered authorization header
   */

  getAuthorizationHeader(): Promise<string | undefined>;

 /**
   * @return true of the current user is authenticated
   */

  isAuthenticated(): Promise<boolean>;

 /**
   * Returns the user details for the current user.
   */

  getUserDetails(): Promise<UserDetails>;

 /**
   * Logs out the current user.
   */

  logout(): Promise<void>;
}

Authentication Manager Provider

The authentication manager provider is in charge of resolving an authentication manager according to the current context (e.g., the current backend).

/**
 * Help to resolve the right Authentication Manager based on the backend
 * type.
 *
 * @since 0.11
 */

interface AuthenticationManagerProvider {
 /**
   *
   * @param type the identifier of the backend type
   * @return the AuthenticationManager registered for the backend type, or undefined if none was fond
   */

  get(type?: string): AuthenticationManager | undefined;
}

User Details

/**
 * Holds the user details, for now the profile link and the name of the user.
 *
 * @since 0.11
 */

export interface UserDetails {
  profile: string;
  name: string;
}
France 2030 Logo

This project is being financed by the French State as part of the France 2030 program

Ce projet est financé par l’État Français dans le cadre de France 2030

  • Powered by XWiki 16.4.4-node2. Hosted and managed by XWiki SAS

Get Connected