{
    "componentChunkName": "component---src-templates-article-page-template-js",
    "path": "/how-to/enable-login-as-user/",
    "result": {"data":{"markdownRemark":{"frontmatter":{"title":"Enable Login as user","slug":"enable-login-as-user","updated":"2020-06-01T00:00:00.000Z","category":"how-to-users-and-authentication","ingress":"This article guides you how to take into use the Login as user feature that allows an operator to log into their marketplace as one of the marketplace users","skills":null},"htmlAst":{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"Login as user"}]},{"type":"text","value":" feature allows marketplace operators to log into\ntheir marketplace as a specific user of the marketplace. This helps\noperators to experience their marketplace as their users do and to find\nout what is wrong when their users are reporting problems. The feature\nalso comes in handy when a marketplace user asks for help with managing\ntheir data and listings. However, note that when logged in as another\nuser "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"it is not possible to modify Stripe account details, send\nmessages, or initiate or transition transactions"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"NOTE:"}]},{"type":"text","value":" In order to enable the Login as user feature you will need to\nbe running at least version 4.2.0 of ftw-daily or 6.2.0 of ftw-hourly.\nAlternatively you will need to perform the modifications described in\nthis guide to your marketplace website."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"how-the-login-as-user-feature-works","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#how-the-login-as-user-feature-works","ariaLabel":"how the login as user feature works permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"How the Login as user feature works"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"As context, here's a quick description of the technical implementation\nof how the Login as user works to make it easier to understand the\nchanges it requires. The authentication flow uses the "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"authorization\ncode"}]},{"type":"text","value":" grant type defined in the OAuth2. Console works as an\n"},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"authorization server"}]},{"type":"text","value":" that issues an authorization code for FTW. FTW\nthen uses this code to obtain an access token from Auth API. The access\ntoken is valid for 30 minutes and it does not come with a refresh token.\nThe token can be used as a normal token obtained with a password login\nexcluding updating payment information, sending messages, and initiating\nor transitioning transactions. The image below describes the\nauthentication flow in more detail."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-wrapper"],"style":"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 635px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"a","properties":{"className":["gatsby-resp-image-link"],"href":"/docs/legacy/static/c8d9931f4f6c49130dc1fd2bafd42199/d3c05/authentication-flow.png","style":"display: block","target":"_blank","rel":["noopener"]},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 96.85534591194967%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAYAAACQjC21AAAACXBIWXMAAAsTAAALEwEAmpwYAAACWUlEQVQ4y42UW1PjMAyF+/9/3M7uDgXaAk2TXuxY8iW+BJ7OjpW2pMAyPGji2O2nY+koi91BY7l6xrG3GMobfBol6rrZK9TzOL6hPfZYrl+gyCPkV7hYJOr6oAkPTw2ag8KCY8aGWQ6NG6BtkPCx4MladD5gSBOAhyzPmvACvKwpJHkuKGb87nsYlaAp4KU7oVUGTmcsjwZN8IhnoB3yFXC5yWVthzIDag2jIpwpIIqwpsDrgpUmtOFW4VzdXKU9q1/YWNC6IJsUIhQ59Pb8PuQrREBD+UbhDLizU6HJRyl8bURtigsFNmT4YYQJGTvnb+r2JbBe+Y/ppXt7TVhtW2z3J+m60VFqa/uMoxpwR/Qz4B0bGBtxUIymU2gPPZRxoq5GiCNUiLjnHwJrU0gnOCoSlgqMibJXm3VReP8ThbWGpzDAlxE+jwjl9Ro2FVgx7yhrHeKXHvwEbKyD8wXkIg6acSKHEArWhm+MPe/yf21Tr/yr12CTpXbrbYfn7gjWEQ+KsAvhamz+xtg8B/5lA5cLXHrPGssrVo7RzhTKpMTxRpGA47vqCUi91GqetUJWzDIpsX4MpJ6TwlqWTbPHc3uEZi97nQvCOAPNlG2WSYCW0RgPX0eyT+JL5iQ1vt+8YN100NaDTMJv3aOyJttQLwquClMRVY+WsTUegQuYsvyR7DSeSnucTg5KeRAlGQ4Bcix41ARSCayz/LAqcSpjoxhtVUjvwJ4GdMrAcobjIlHPlsZMwKsd4kc7nN+r8jx51KaZbWb7NWg4fw/nXvoY17P42Xs3Ppx1+R9Bi6SOOZoZ3gAAAABJRU5ErkJggg=='); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"picture","properties":{},"children":[{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/c8d9931f4f6c49130dc1fd2bafd42199/82e29/authentication-flow.webp 159w","/docs/legacy/static/c8d9931f4f6c49130dc1fd2bafd42199/ef33f/authentication-flow.webp 318w","/docs/legacy/static/c8d9931f4f6c49130dc1fd2bafd42199/f1837/authentication-flow.webp 635w","/docs/legacy/static/c8d9931f4f6c49130dc1fd2bafd42199/21783/authentication-flow.webp 700w"],"sizes":"(max-width: 635px) 100vw, 635px","type":"image/webp"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/c8d9931f4f6c49130dc1fd2bafd42199/8b9b5/authentication-flow.png 159w","/docs/legacy/static/c8d9931f4f6c49130dc1fd2bafd42199/fa108/authentication-flow.png 318w","/docs/legacy/static/c8d9931f4f6c49130dc1fd2bafd42199/53fb6/authentication-flow.png 635w","/docs/legacy/static/c8d9931f4f6c49130dc1fd2bafd42199/d3c05/authentication-flow.png 700w"],"sizes":"(max-width: 635px) 100vw, 635px","type":"image/png"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"src":"/docs/legacy/static/c8d9931f4f6c49130dc1fd2bafd42199/53fb6/authentication-flow.png","alt":"Authentication flow","title":"Authentication flow","loading":"lazy","decoding":"async","style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;"},"children":[]},{"type":"text","value":"\n        "}]},{"type":"text","value":"\n  "}]},{"type":"text","value":"\n    "}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Note:"}]},{"type":"text","value":" Remember to make sure that the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"REACT_APP_CANONICAL_ROOT_URL"}]},{"type":"text","value":"\nvalue configured in your marketplace website matches the marketplace URL\nconfigured in Console as the value will be used to redirect back to your\nmarketplace and the value is validated in console when issuing an\nauthorization code."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"applying-the-changes-to-your-marketplace-website","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#applying-the-changes-to-your-marketplace-website","ariaLabel":"applying the changes to your marketplace website permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Applying the changes to your marketplace website"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The easiest way to take the feature into use is to merge the latest\nchanges from the FTW projects. The required version to have is 4.2.0\nwith ftw-daily and 6.2.0 with ftw-hourly."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In case merging upstream changes is not a reasonable solution, the\nchanges can also be applied manually."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"update-the-flex-sdk-and-auth-handling-in-ftw","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#update-the-flex-sdk-and-auth-handling-in-ftw","ariaLabel":"update the flex sdk and auth handling in ftw permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Update the Flex SDK and auth handling in FTW"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Version 1.9.0 of the Flex JavaScript SDK is required. Make sure that the\ndependency looks as follows in your "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"package.json"}]},{"type":"text","value":" file."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"javascript"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-javascript"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-javascript"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","string-property","property"]},"children":[{"type":"text","value":"\"sharetribe-flex-sdk\""}]},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":":"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"\"^1.9.0\""}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"With the updated SDK auth state handling can be changed to utilize a new\nauth info attribute returned by the SDK. Update the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"authenticated"}]},{"type":"text","value":"\nfunction in the top part of the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"src/ducks/Auth.duck.js"}]},{"type":"text","value":" file as\nfollows:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"javascript"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-javascript"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-javascript"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","function-variable","function"]},"children":[{"type":"text","value":"authenticated"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","parameter"]},"children":[{"type":"text","value":"authInfo"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"=>"}]},{"type":"text","value":"\n  authInfo "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"&&"}]},{"type":"text","value":" authInfo"},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"."}]},{"type":"text","value":"isAnonymous "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"==="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","boolean"]},"children":[{"type":"text","value":"false"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"add-required-endpoints-to-the-ftw-server","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#add-required-endpoints-to-the-ftw-server","ariaLabel":"add required endpoints to the ftw server permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Add required endpoints to the FTW server"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In order to handle the authentication flow, FTW needs to implement two\nserver-side endpoints: "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/api/initiate-login-as"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/api/login-as"}]},{"type":"text","value":". To\nadd them to the Node server, copy "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"server/apiRouter.js"}]},{"type":"text","value":",\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"server/api/initiate-login-as.js"}]},{"type":"text","value":", and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"server/api/login-as.js"}]},{"type":"text","value":" files\nfrom the FTW daily repository:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/ftw-daily/tree/master/server","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"https://github.com/sharetribe/ftw-daily/tree/master/server"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Then add the following line into your "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"server/index.js"}]},{"type":"text","value":" file, above the\nmain "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"app.get('*' (req, res) => {"}]},{"type":"text","value":" route declaration:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"javascript"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-javascript"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-javascript"]},"children":[{"type":"text","value":"app"},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"."}]},{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"use"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"("}]},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"'/api'"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":" apiRouter"},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":")"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Now you can log into the marketplace from Console's user view."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"show-a-banner-when-logged-in-as-a-user","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#show-a-banner-when-logged-in-as-a-user","ariaLabel":"show a banner when logged in as a user permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Show a banner when logged in as a user"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The endpoints of the previous section enable the Login as user feature.\nHowever, this will not notify the operator in any way that they are\nlogged in as a user and have a limited set of actions in their use. The\nFlex template applications ftw-daily and ftw-hourly provide such a\nbanner. The changes for showing the banner are a bit more complex what\nis required for adding the endpoints described above so in order to show\na notification to an operator it is advised to pull upstream updates.\nHowever, in case that is not a viable option the notification banner\nchanges to the FTWs are in\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/ftw-daily/pull/1259","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"this PR"}]},{"type":"text","value":" and can be\napplied from there as one sees best."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"troubleshooting","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#troubleshooting","ariaLabel":"troubleshooting permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Troubleshooting"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Having trouble enabling the Login as user feature? Check that you have\nthe following in order."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"authentication-fails-with-message-failed-to-authorize-as-a-user-error-error-message","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#authentication-fails-with-message-failed-to-authorize-as-a-user-error-error-message","ariaLabel":"authentication fails with message failed to authorize as a user error error message permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Authentication fails with message: Failed to authorize as a user, error: "},{"type":"element","tagName":"error","properties":{"message":""},"children":[]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Double check that the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"REACT_APP_CANONICAL_ROOT_URL"}]},{"type":"text","value":" environment\nvariable of your marketplace website matches the Marketplace URL you\nhave configured in Console."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"authentication-fails-with-message-unable-to-authenticate-as-a-user","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#authentication-fails-with-message-unable-to-authenticate-as-a-user","ariaLabel":"authentication fails with message unable to authenticate as a user permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Authentication fails with message: Unable to authenticate as a user"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Have you updated the SDK to the latest version?"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"login-session-drops-unexpectedly","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#login-session-drops-unexpectedly","ariaLabel":"login session drops unexpectedly permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Login session drops unexpectedly"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The access token obtained with the Login as user authentication flow is\nvalid only for 30 minutes. If you could not finish what you had in mind\nduring that time you can always login as the user again."}]}],"data":{"quirksMode":false}},"headings":[{"value":"How the Login as user feature works","depth":2},{"value":"Applying the changes to your marketplace website","depth":2},{"value":"Update the Flex SDK and auth handling in FTW","depth":3},{"value":"Add required endpoints to the FTW server","depth":3},{"value":"Show a banner when logged in as a user","depth":3},{"value":"Troubleshooting","depth":2},{"value":"Authentication fails with message: Failed to authorize as a user, error: <error message>","depth":3},{"value":"Authentication fails with message: Unable to authenticate as a user","depth":3},{"value":"Login session drops unexpectedly","depth":3}]}},"pageContext":{"slug":"enable-login-as-user","category":"how-to-users-and-authentication"}},
    "staticQueryHashes": ["3794076007","439097193","717698143"]}