Warning
You are viewing the technical documentation for the Sharetribe Developer Platform. If you are looking for our no-code documentation, see our new help center.

Last updated

Login as user

This article provides guidance on how to use the "Login as User" feature. This functionality allows an operator to log into their marketplace as one of the marketplace users.

Table of Contents

The Login as user feature allows marketplace operators to log into their marketplace as a specific user of the marketplace. This helps operators to experience their marketplace as their users do and to find out what is wrong when their users are reporting problems. The feature also comes in handy when a marketplace user asks for help with managing their data and listings.

In both Test and Dev environments, you get full access to user profiles and actions with this feature. However, when logged in as a user in a Live environment, it is not possible to modify Stripe account details, send messages, or initiate or transition transactions.

How the Login as user feature works

As context, here's a quick description of the technical implementation of how the Login as user works to make it easier to understand the changes it requires. The authentication flow uses the authorization code grant type defined in the OAuth2. Console works as an authorization server that issues an authorization code for Sharetribe Web Template. The template then uses this code to obtain an access token from Auth API. The access token is valid for 30 minutes and it does not come with a refresh token. The token can be used as a normal token obtained with a password login excluding updating payment information, sending messages, and initiating or transitioning transactions. The image below describes the authentication flow in more detail.

Authentication flow

Troubleshooting

Having trouble enabling the Login as user feature? Check that you have the following in order.

Authentication fails with message: Failed to authorize as a user, error:

Double check that the REACT_APP_MARKETPLACE_ROOT_URL environment variable of your marketplace website matches the Marketplace URL you have configured in Console.

Authentication fails with message: Mismatch between redirect_uri parameter value and Marketplace URL

Double check that the REACT_APP_MARKETPLACE_ROOT_URL environment variable of your marketplace website matches the Marketplace URL you have configured in Console.

Authentication fails with message: Unable to authenticate as a user

Have you updated the SDK to the latest version?

Login session drops unexpectedly

The access token obtained with the Login as user authentication flow is valid only for 30 minutes. If you could not finish what you had in mind during that time you can always login as the user again.