Skip to content

fucodo/accountSwitcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fucodo Account Switcher

This package provides a mechanism to impersonate other accounts in a Neos Flow application. It includes a REST API for managing impersonation sessions.

Installation

The package should be placed in DistributionPackages/fucodo.accountSwitcher.

API Endpoints

The package provides the following API endpoints (all returning JSON):

  • GET /api/v1/fucodo/accountswitcher/currentAccount: Get current impersonation status.
  • POST /api/v1/fucodo/accountswitcher/switch: Switch to a different account.
  • POST /api/v1/fucodo/accountswitcher/reset: Reset impersonation.

For detailed API documentation, see Documentation/openapi.yaml.

Usage Example

JavaScript Example for Account Switching

The following example demonstrates how to switch to another account using the API:

const response = await fetch(
  `${window.location.origin}/api/v1/fucodo/accountswitcher/switch?accountIdentifier=sysadmin-2&authenticationProviderName=DefaultProvider`,
  {
    method: 'POST',
    headers: {
      'accept': 'application/json'
    },
    body: ''
  }
);
const data = await response.json();
console.log(data);

JavaScript Example for Resetting Impersonation

The following example demonstrates how to reset the impersonation session:

const response = await fetch(
  `${window.location.origin}/api/v1/fucodo/accountswitcher/reset`,
  {
    method: 'POST',
    headers: {
      'accept': 'application/json'
    },
    body: ''
  }
);
const data = await response.json();
console.log(data);

Configuration

The routes are automatically registered if the package is active. You can adjust the route position in Configuration/Settings.Neos.Flow.mvc.yaml.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages