Skip to main content
Version: 1.x

Interface: AuthStrategy

Authentication strategy interface.

Remarks​

All authentication strategies (onprem, cloud-saml, office365, api, certificate, multi-tenant) implement this interface to provide a consistent authentication API.

Example​

const strategy: AuthStrategy = createOnPremStrategy();
await strategy.authenticate(page, config);
const loggedIn = await strategy.isAuthenticated(page);

Properties​

name​

readonly name: string

Human-readable strategy name (e.g., 'onprem', 'cloud-saml').

Methods​

authenticate()​

authenticate(page, config): Promise<void>

Authenticate against the SAP system.

Parameters​

page​

AuthPage

Playwright page for browser interactions.

config​

Readonly<SAPAuthConfig>

SAP authentication configuration.

Returns​

Promise<void>

Example​

await strategy.authenticate(page, config);

isAuthenticated()​

isAuthenticated(page): Promise<boolean>

Check if the current page session is authenticated.

Parameters​

page​

AuthPage

Playwright page to check.

Returns​

Promise<boolean>

true if authenticated (shell header visible).

Example​

const isAuth = await strategy.isAuthenticated(page);