@ownid/azure-b2c
Version:
Server-side library for integrating OwnID passwordless authentication with Azure Active Directory B2C
41 lines (40 loc) • 1.23 kB
TypeScript
import { OwnIDB2CAuth } from './auth';
import { OwnIDB2CUser, OwnIDSessionToken } from '../types';
/**
* Service to manage user operations with Azure B2C
*/
export declare class OwnIDB2CUserService {
private auth;
private ownIdExtensionName;
constructor(auth: OwnIDB2CAuth);
/**
* Find a user by their email address
*
* @param email - Email address to search for
* @returns User object if found, null otherwise
*/
findUserByEmail(email: string): Promise<OwnIDB2CUser | null>;
/**
* Store OwnID data for a user
*
* @param userId - Azure B2C user ID
* @param data - OwnID data to store
* @returns true if successful
*/
setOwnIdData(userId: string, data: any): Promise<boolean>;
/**
* Get OwnID data for a user
*
* @param userId - Azure B2C user ID
* @returns User object with OwnID data if exists
*/
getOwnIdData(userId: string): Promise<OwnIDB2CUser>;
/**
* Get authentication tokens for a user
*
* @param userId - Azure B2C user ID
* @param email - User's email address
* @returns Authentication tokens
*/
getTokens(userId: string, email: string): Promise<OwnIDSessionToken>;
}