agentsclimarketplace

Sap authentication

Skill mrkanitkar/praman-sap-testing/skills/sap-authentication

This skill should be used when implementing "SAP login", "IDP redirect chains", "SSO configuration", "certificate-based authentication", or "BTP SAML2/IAS" in Playwright tests. Covers basic form auth, Office 365 SSO, API keys, multi-tenant, and mTLS.From its SKILL.md

Install
npx -y skills add mrkanitkar/praman-sap-testing --skill sap-authentication

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.7 KB, as published. Nobody here has run it

SAP Authentication

Select the authentication strategy based on the SAP landscape:

LandscapeStrategyHandler Config Key
SAP OnPrembasicusername + password
BTP Cloud Foundrybtp-samlIAS/SAML2 redirect
Azure AD SSOoffice365OAuth2 code flow
API-only accesscustomAPI key / bearer
Certificate authcustommTLS + client cert

Auth Setup Pattern

Use Playwright project dependencies to run authentication once and share state across tests.

Configure playwright.config.ts with a setup project that depends on nothing and produces storageState. All test projects depend on this setup project.

Create auth-setup.ts using SAPAuthHandler:

  1. Import test as setup from playwright-praman.
  2. Instantiate SAPAuthHandler with page and pramanConfig.auth.
  3. Call handler.login() which auto-detects the login form and IDP redirects.
  4. Persist session with page.context().storageState({ path: '.auth/session.json' }).

Environment Variables

Store credentials in .env.test (gitignored, never committed):

  • SAP_CLOUD_BASE_URL -- system base URL
  • SAP_CLOUD_USERNAME -- login username
  • SAP_CLOUD_PASSWORD -- login password
  • SAP_CLIENT -- SAP client number (optional)
  • SAP_IDP_HOST -- custom IDP hostname (optional, for BTP SAML)

Load via dotenv or Playwright's built-in env config.

Multi-Tenant and BTP Subaccounts

For multi-tenant BTP apps, set the tenant subdomain in SAP_CLOUD_BASE_URL. The auth handler follows the IAS redirect chain automatically. Pass tenant in auth config for explicit tenant selection.

Session Reuse

Store storageState at .auth/session.json. Playwright reuses cookies and local storage across tests in the same project, eliminating redundant logins. Regenerate on CI by running the setup project before test projects.

Raw Seed Auth (CLI Agents)

When Praman fixtures are unavailable (e.g., playwright-cli browser context during exploration), use raw Playwright auth. Detect the login form by checking for known input selectors and IAS hostnames, fill credentials via CLI commands, and wait for sap.ui.getCore to confirm UI5 loaded. See examples/raw-seed-auth.ts.

Refer to examples/ for complete auth setup patterns per strategy.

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.