{"componentChunkName":"component---node-modules-arcblock-gatsby-theme-docs-src-templates-documentation-js","path":"/en/developer/auth-service","result":{"data":{"file":{"changeTime":"5 minutes ago","childMarkdownRemark":{"frontmatter":{"author":"linchen","category":"","date":null,"description":"Auth Service Instructions","draft":null,"keywords":"abtnode, blocklet, service, auth","language":"en","layout":"documentation","path":"/en/developer/auth-service","tags":["abtnode","blocklet","service","auth"],"title":"Configure Auth Service for Blocklet"},"htmlAst":{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Auth Service is a general Auth service provided by ABT Node for Blocklet."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Blocklet can be declaratively enabled and configured Auth Service in "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"blocklet.yml"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Auth Service includes the following main capabilities:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Set accessible after login"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Set accessible after authorization"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Set invitation login or open login"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"getting-started","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#getting-started","ariaLabel":"getting started 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":"Getting Started"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://github.com/blocklet/html-2048-sample"},"children":[{"type":"text","value":"static-demo-blocklet"}]},{"type":"text","value":" is an html5 game that can be run on ABT Node. The following will introduce how to make a static-demo-blocklet with Auth capability (login protection)"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{"start":0},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Prerequisites: Install and run ABT Node v1.2.0 or higher locally"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Download the project source code "},{"type":"element","tagName":"a","properties":{"href":"https://github.com/blocklet/html-2048-sample"},"children":[{"type":"text","value":"html-2048-sample"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Open "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"blocklet.yml"}]},{"type":"text","value":" in the project root directory, find the interface whose name is publicUrl, and add the Auth Service configuration"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-yml"],"yml":""},"children":[{"type":"text","value":"interfaces:\n  - type: web\n    name: publicUrl\n    path: /\n    prefix: '*'\n    port: BLOCKLET_PORT\n    protocol: tcp\n+   services:\n+     - name: '@abtnode/auth-service'\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{"start":3},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Execute "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"blocklet bundle"}]},{"type":"text","value":" in the project root directory. After successful execution, you will see the successfully created blocklet bundle in "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":".blocklet/bundle"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"linchen@LinkdeMacBook-Pro html-2048-sample % blocklet bundle\n\nℹ Bundling in zip mode for blocklet static-demo-blocklet...\n\n✔ Creating blocklet bundle in .blocklet/bundle... Done in 0.018s\n✔ Blocklet static-demo-blocklet@1.1.7 is successfully bundled!\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{"start":4},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Execute "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"blocklet deploy .blocklet/bundle"}]},{"type":"text","value":" in the project root directory to publish the blocklet bundle to the locally running ABT Node."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"linchen@LinkdeMacBook-Pro html-2048-sample % blocklet deploy .blocklet/bundle\nℹ Try to deploy blocklet from /Users/linchen/code/blocklet/html-2048-sample/.blocklet/bundle to Local ABT Node\nℹ Node did from config zNKqGAvUzcCowxtNA5r5gKQYUm2hR4X2SE2o\nℹ Load config from /Users/linchen/code/arcblock/andata/.abtnode/abtnode.yml\n✔ Blocklet static-demo-blocklet@1.1.7 was successfully deployed!\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{"start":5},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Start Static Demo in ABT Node dashboard"}]},{"type":"text","value":"\n"}]},{"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: 1000px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 62.4%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAIAAADtbgqsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/0lEQVQoz52RQU7EMAxFc/8LsUdiwQIkTsCGtumQNInj2E5nww/dgAYGNFFkNXaf/4/j/Lp6j7Cup9OWtyKRJKvZb7sy55KYE6fVUa3c2uL9vCx93812tX4FRvXxxe7u7eHJXCECD+lpnreUrmJjQykm9e+K6CoWcwghblsuBWVRJWbtQx+ZJhJjtE8s5YyMaKtMauJYWmztGXAIwIZnlfo25elVcmA9I5lyOm5H0FEiAW9i6tacYqUysC/2iBQ5aZfTghG0O6ILMRaqvX8fEo69/3l/hyENSyLoejQehWOZXgL4Af4xZnwcymT/0PlZGYI3wpCFjRvIAePdboY/AFBJsO7Pw4fwAAAAAElFTkSuQmCC'); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"alt":"static demo 1","title":"static demo 1","src":"/abtnode/static/3bf5acc2856ae6e5d5cc339211202dd5/ea415/static-demo-1.png","srcSet":["/abtnode/static/3bf5acc2856ae6e5d5cc339211202dd5/41b2e/static-demo-1.png 250w","/abtnode/static/3bf5acc2856ae6e5d5cc339211202dd5/36a81/static-demo-1.png 500w","/abtnode/static/3bf5acc2856ae6e5d5cc339211202dd5/ea415/static-demo-1.png 1000w","/abtnode/static/3bf5acc2856ae6e5d5cc339211202dd5/5dce9/static-demo-1.png 1500w","/abtnode/static/3bf5acc2856ae6e5d5cc339211202dd5/25a1a/static-demo-1.png 2000w","/abtnode/static/3bf5acc2856ae6e5d5cc339211202dd5/acb5a/static-demo-1.png 2782w"],"sizes":["(max-width:","1000px)","100vw,","1000px"],"style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;","loading":"lazy"},"children":[]},{"type":"text","value":"\n    "}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{"start":6},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"When you visit Static Demo, you will see the login page, which means that Static Demo already has the Auth capability."}]},{"type":"text","value":"\n"}]},{"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: 1000px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 113.6%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAXCAIAAACEf/j0AAAACXBIWXMAAAsTAAALEwEAmpwYAAACRklEQVQ4y41UXYvaUBDdf9V/sYXal7aytYjstugatFhUFPVF7IMWbKnIllYoZUFKC33RCtvW0A+Q/gVFDComakzMTUxi7EnS2pXdEIdhNDPn3Jm5d+49kBXlWlVWK03XoU4A6IETU1wuJyw7m8/3JYOzUlVY3TCGw2Gr1ep0OkSWbSesIxlhfrEYMAzLcXOeh2UYZjQeTzhuOpvBA8VC15BXlsiELARhKZlCCFFVFc4lhBDJUhsG9F8ysXJurohhGCzL8jx/NbRerx3J6gouBQWi7clkYlYqy9j4vcjjMccvBJQniKIgCEg+naJhwSrHmWxYwV+/uUbzK01/a7fbNE3/+E5//ET3h7oreQ2LTaYoKhAIhEIhn88Xi8UqlZeCIG5Xv54MLyxOKxgM+v3+fD6fy+WSyWS5/Bxbvhe53+9HIpFMJlOtVguFQjQarVQqODYXsh0bDAZgglYqlRKJRDabrdVqQO2VudvtZrOZYrEYj8dTqVQ4TJ2dVUXRvWcz9rMzeP3m7ZeLi3q93mw2z8/fvf/wmRm7lW0LLxiqOREGQJqGEzIkZSPJbhOGhe3KYa1bpGGfNE21g3C6Z8YnfMBhJMlSlURFIpKu646Z7YQYqXQ6jdnAUZ2cHD8rlV+8Sp0+vnMapCIR6tHD49FoBJj+73nZITcajXA47PF4vF7v4c3D+JNU5ukDz70b3rv3j468tz23er0eYNu3ybzPdpF2P5qm7VzM9cYa2f/31GxnW7b9gyfC1sv/TVXknc9LMMcHcE/9A0Gj5bhZE02xAAAAAElFTkSuQmCC'); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"alt":"static demo 2","title":"static demo 2","src":"/abtnode/static/924bb30e7ef3ca3c5601ae9278108901/ea415/static-demo-2.png","srcSet":["/abtnode/static/924bb30e7ef3ca3c5601ae9278108901/41b2e/static-demo-2.png 250w","/abtnode/static/924bb30e7ef3ca3c5601ae9278108901/36a81/static-demo-2.png 500w","/abtnode/static/924bb30e7ef3ca3c5601ae9278108901/ea415/static-demo-2.png 1000w","/abtnode/static/924bb30e7ef3ca3c5601ae9278108901/37d1e/static-demo-2.png 1388w"],"sizes":["(max-width:","1000px)","100vw,","1000px"],"style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;","loading":"lazy"},"children":[]},{"type":"text","value":"\n    "}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{"start":7},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"After the login is successful, you will successfully see the game page. At this point, you will see the information of the logged-in user in the ABT Node dashboard."}]},{"type":"text","value":"\n"}]},{"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: 1000px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 64%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsTAAALEwEAmpwYAAABIElEQVQoz52Sy27EIAxF8/9f1H1/o9KoitRREoLNwzbQWfQS5tGuqhlkISR8rq8x0+49E0XnEnmJnFWs1tKalXKPUuvtXEUlppxSzsFPIUZjMvItx8J0KSqquEKqmo09i9yFtIvhYGo6EXPeFn/+yt6pW+eZT/O6uQ1MTGmQHMKNtEeUMiEjSvYpiCJN3t7t47N+XxqsjhgY7CCuLRwkuuu2AaG+1ipmrWWoBLQl0sVUcKYQiMkTIRlYr0dsqhMeDB3CGJwAllKRvTmHVFztfucAa2Y1QytgoRIk1k2JOzwsjU7uz/snfj17ORYcdtuA9WjmhZi23cut4NOwX86akj2+wTPwMp/wsay2V2DGkF623b+RGqY14l8hzAUzA4X9B7f166gb9N7RAAAAAElFTkSuQmCC'); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"alt":"static demo 3","title":"static demo 3","src":"/abtnode/static/cbd9bc1ac9dd54e40e1435e47cd00dc8/ea415/static-demo-3.png","srcSet":["/abtnode/static/cbd9bc1ac9dd54e40e1435e47cd00dc8/41b2e/static-demo-3.png 250w","/abtnode/static/cbd9bc1ac9dd54e40e1435e47cd00dc8/36a81/static-demo-3.png 500w","/abtnode/static/cbd9bc1ac9dd54e40e1435e47cd00dc8/ea415/static-demo-3.png 1000w","/abtnode/static/cbd9bc1ac9dd54e40e1435e47cd00dc8/5dce9/static-demo-3.png 1500w","/abtnode/static/cbd9bc1ac9dd54e40e1435e47cd00dc8/25a1a/static-demo-3.png 2000w","/abtnode/static/cbd9bc1ac9dd54e40e1435e47cd00dc8/5ee56/static-demo-3.png 2770w"],"sizes":["(max-width:","1000px)","100vw,","1000px"],"style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;","loading":"lazy"},"children":[]},{"type":"text","value":"\n    "}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Congratulations!"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"demo","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#demo","ariaLabel":"demo 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":"Demo"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://github.com/blocklet/auth-demo"},"children":[{"type":"text","value":"https://github.com/blocklet/auth-demo"}]},{"type":"text","value":": Implement login, logout, display user information, authentication and authorization functions based on Auth Service"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"enable-auth-service","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#enable-auth-service","ariaLabel":"enable auth service 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":"Enable Auth Service"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Enable Auth Service by configuring in "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"blocklet.yml"}]},{"type":"text","value":", under the interface that needs to start Auth Service"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-yml"],"-":"","type:":"","web":""},"children":[{"type":"text","value":"interfaces:\n  - type: web\n    name: xxxx\n    # ... other interface config\n    services:\n      - name: '@abtnode/auth-service'\n      - config:\n        # ...\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"configuration","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#configuration","ariaLabel":"configuration 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":"Configuration"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"e.g."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-yml"],"-":"","type:":"","web":""},"children":[{"type":"text","value":"interfaces:\n  - type: web\n    name: publicUrl\n    # ... other interface config\n    services:\n      - name: '@abtnode/auth-service'\n        config:\n          invitedUserOnly: no\n          profileFields:\n            - fullName\n            - email\n            - avatar\n          webWalletUrl: https://web.abtwallet.io\n          ignoreUrls:\n            - /public/**\n          blockUnauthenticated: true\n          blockUnauthorized: false\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"invitedUserOnly: Is only invited users are allowed to login?"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"default: no"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"profileFields: What info do you want user to provide when login?"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"default: [fullName, email, avatar]"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"blockUnauthenticated: Do you want Auth Service block unauthenticated requests for you?"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"default: true"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"blockUnauthorized: Do you want Auth Service block unauthorized requests for you?"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"default: false"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"ignoreUrls: Which URLs do not need to be protected?"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"default: none"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"webWalletUrl: The URL of your preferred web wallet instance"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"default: "},{"type":"element","tagName":"a","properties":{"href":"https://web.abtwallet.io"},"children":[{"type":"text","value":"https://web.abtwallet.io"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"set-accessible-after-login","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#set-accessible-after-login","ariaLabel":"set accessible after login 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":"Set accessible after login"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"After Auth Service is enabled, Auth Service will automatically intercept requests that are not logged in and jump to the Auth Service login page."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If Blocklet wants to handle unlogged requests by itself, it can be configured as follows:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-yml"],"-":"","type:":"","web":""},"children":[{"type":"text","value":"interfaces:\n  - type: web\n    name: xxxx\n    # ... other interface config\n    services:\n      - name: '@abtnode/auth-service'\n        config:\n          blockUnauthenticated: false\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"set-accessible-after-authorization","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#set-accessible-after-authorization","ariaLabel":"set accessible after authorization 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":"Set accessible after authorization"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"After enabling Auth Service, Auth Service will "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"not"}]},{"type":"text","value":" automatically intercept unauthorized requests. Blocklet needs to handle it by itself."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If Blocklet wants Auth Service to automatically intercept unauthorized requests, you can do the following configuration:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-yml"],"-":"","type:":"","web":""},"children":[{"type":"text","value":"interfaces:\n  - type: web\n    name: xxxx\n    # ... other interface config\n    services:\n      - name: '@abtnode/auth-service'\n        config:\n          blockUnauthorized: true\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"After setting the Auth Service automatic interception, you need to bind the corresponding interface permissions for the user in the ABT Node dashboard.（The permission control of ABT Node is based on "},{"type":"element","tagName":"a","properties":{"href":"https://en.wikipedia.org/wiki/Role-based_access_control"},"children":[{"type":"text","value":"RBAC"}]},{"type":"text","value":"）"}]},{"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: 1000px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 55.199999999999996%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA40lEQVQoz5VRy3LDIAzk/z+vt15yySHTaXDACD3gksVKsCfTplO81gjZK2mlcEspr+taCiwxi7GZsIiowlKtAPwJD1ZmWlMoRGrWesddxHpvrQ8PV9iUc1yWI3kCJ6DgoKlS5db4dJaPT7GG4r9Wnn5Aw07Ga02/Ip8vj2+Ie2rwj0J2cs65Pu84hSUmKSTOwUQcUIfIhOcKUOXJGFTTpfDlWwsNJgjXGB3wXYLDm93bnpLQIh44sMdSL9grY+A/jvQ9wm1br/6fOchLpbKRj/28wdA12x7L2Ab2kPcX2bfgv90BvRt6CaEmU6cAAAAASUVORK5CYII='); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"alt":"permissions","title":"permissions","src":"/abtnode/static/cd1c9e55b6ed5ab370e70e9fa07558d7/ea415/permissions.png","srcSet":["/abtnode/static/cd1c9e55b6ed5ab370e70e9fa07558d7/41b2e/permissions.png 250w","/abtnode/static/cd1c9e55b6ed5ab370e70e9fa07558d7/36a81/permissions.png 500w","/abtnode/static/cd1c9e55b6ed5ab370e70e9fa07558d7/ea415/permissions.png 1000w","/abtnode/static/cd1c9e55b6ed5ab370e70e9fa07558d7/5dce9/permissions.png 1500w","/abtnode/static/cd1c9e55b6ed5ab370e70e9fa07558d7/25a1a/permissions.png 2000w","/abtnode/static/cd1c9e55b6ed5ab370e70e9fa07558d7/8638d/permissions.png 3544w"],"sizes":["(max-width:","1000px)","100vw,","1000px"],"style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;","loading":"lazy"},"children":[]},{"type":"text","value":"\n    "}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"set-invitation-login-or-open-login","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#set-invitation-login-or-open-login","ariaLabel":"set invitation login or open login 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":"Set invitation login or open login"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Configure invitation login or open login via "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"invitedUserOnly"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-yml"],"-":"","type:":"","web":""},"children":[{"type":"text","value":"interfaces:\n  - type: web\n    name: xxxx\n    # ... other interface config\n    services:\n      - name: '@abtnode/auth-service'\n        config:\n          invitedUserOnly: yes\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"invitedUserOnly"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"no: Open login (default)"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"yes: Only log in via invitation link"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"not-first: Only the first login user does not need to go through the invitation link"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]}],"data":{"quirksMode":false}}}}},"pageContext":{"site":{"title":"ABT Node","description":"ABT Node Documentation","siteUrl":"https://docs.arcblock.io","logoUrl":"/abtnode/","sidebarWidth":360,"disableI18n":false,"showGetStarted":true,"defaultBanner":"/abtnode/og-banner.png"},"id":"7d13200c-110b-5ba1-a09d-ee95fd2566c8","language":"en","locale":"en","languages":[{"value":"en","text":"English"},{"value":"zh","text":"简体中文"}],"headings":[{"value":"Getting Started","depth":2},{"value":"Demo","depth":2},{"value":"Enable Auth Service","depth":2},{"value":"Configuration","depth":2},{"value":"Set accessible after login","depth":2},{"value":"Set accessible after authorization","depth":2},{"value":"Set invitation login or open login","depth":2}],"navItems":[{"group":"/home/runner/work/abtnode-docs/abtnode-docs/src","title":"ABT Node","priority":999,"link":"/"}],"version":"v0.2.20","official":true,"originalPath":"/en/developer/auth-service","sidebarContent":[{"url":null,"title":null,"pages":[{"title":"ABT Node Docs","path":"/en/"}]},{"url":"/en/introduction","title":"Introduction","pages":[{"title":"ABT Node Overview","path":"/en/introduction/abtnode-overview"},{"title":"ABT Node Setup","path":"/en/introduction/abtnode-setup"},{"title":"ABT Node Access","path":"/en/introduction/abtnode-access"}]},{"url":"/en/marketplace","title":"Marketplace","pages":[{"title":"Find and Install Blocklets","path":"/en/marketplace/find-and-install"},{"title":"Upgrade/downgrade blocklet","path":"/en/marketplace/upgrade-downgrade"}]},{"url":"/en/blocklet","title":"Blocklets","pages":[{"title":"Basic Operations","path":"/en/blocklet/basic-operations"},{"title":"Blocklet Environments","path":"/en/blocklet/environments"},{"title":"Core Blocklets","path":"/en/blocklet/core-blocklets"}]},{"url":"/en/router","title":"Service Gateway","pages":[{"title":"What is Service Gateway?","path":"/en/router/what-is-router"},{"title":"Service Gateway Usage","path":"/en/router/basic-usage"},{"title":"Binding domain names to sites and enabling SSL","path":"/en/router/bind-domain-and-ssl"},{"title":"Certificates for localhost","path":"/en/router/certificates-for-localhost"}]},{"url":"/en/deployment","title":"Deployment","pages":[{"title":"Production Best Practice","path":"/en/deployment/best-practice"},{"title":"Deploy ABT Node Using AWS AMI","path":"/en/deployment/from-aws-ami"},{"title":"Bind domain with reverse proxy server","path":"/en/deployment/behind-reverse-proxy"},{"title":"Run In Docker","path":"/en/deployment/run-in-docker"}]},{"url":"/en/misc","title":"Misc","pages":[{"title":"Node Settings","path":"/en/misc/node-settings"},{"title":"Member Management","path":"/en/misc/member-management"},{"title":"GraphQL Console","path":"/en/misc/graphql-console"}]},{"url":"/en/developer","title":"Developer Guide","pages":[{"title":"Configuring the development environment","path":"/en/developer/config-dev-env"},{"title":"ABT Node CLI","path":"/en/developer/abtnode-cli"},{"title":"Node Configuration","path":"/en/developer/configuration"},{"title":"Storage Structure","path":"/en/developer/storage-structure"},{"title":"Blocklet Specification","path":"/en/developer/blocklet-spec"},{"title":"Create Static Blocklets","path":"/en/developer/static-blocklets"},{"title":"Create DApp Blocklets","path":"/en/developer/dapp-blocklets"},{"title":"Blocklet Hooks","path":"/en/developer/blocklet-hooks"},{"title":"Bundle Blocklets","path":"/en/developer/bundle-blocklets"},{"title":"Publish Blocklets","path":"/en/developer/publish-blocklets"},{"title":"Blocklet Registry","path":"/en/developer/blocklet-registry"},{"title":"Developing Blocklets with Codespaces","path":"/en/developer/blocklet-codespaces"},{"title":"Configure Auth Service for Blocklet","path":"/en/developer/auth-service"},{"title":"Composable blocklet","path":"/en/developer/composable-blocklet"},{"title":"Docker Registry List","path":"/en/developer/docker-registry"}]}],"communityPath":"https://community.arcblockio.cn","githubUrl":"https://github.com/ArcBlock/abtnode-docs/tree/master/src/developer/auth-service/index.md"}},"staticQueryHashes":["1358860651","1619896071","1812186216","2194038815"]}